RAYLWARD102
Well-known Member
- Joined
- May 27, 2010
- Messages
- 529
I've loaded a data set from our accounting database, into an array. The accounting database users appear to be accidentally pressing the enter key in the description field, saving the data afterwards. When I dump my array containing all of this information, into an excel sheet, the description's (only some rows, 1 in every 400 records) expands the row height to double it's size, due to the invisible paragraph mark I presume. In excel, there is no way to see these characters, but I did find a handy dandy example for detecting if an unwanted character existed in the value: =IF(CLEAN(A1)=A1,"NA","Needs Cleaning")
Great, so I can identify that a cell has some invisible character resulting in the row height being doubled, but have no way, via VBA to remove such a character.
I've tried everything possible, and these marks wont go away; any idea's?
My trying to remove unwanted characters in a loop across fields containing unwanted characters.
as you can see, the application.worksheetfunction.clean can identify the bad character in a cell formula (see above formula example), but cannot be used to produce a clean value (clean by removing paragraph mark)
Pulling my hair out shortly....
Great, so I can identify that a cell has some invisible character resulting in the row height being doubled, but have no way, via VBA to remove such a character.
I've tried everything possible, and these marks wont go away; any idea's?
My trying to remove unwanted characters in a loop across fields containing unwanted characters.
Code:
Eliminate = Chr(13) & Chr(10)
For y = 2 To 6 'fields 2-6
v(F(y), x) = Application.WorksheetFunction.Clean(CStr(v(F(y), x)))
'v(F(y), x) = Replace(v(F(y), x), Chr(182), "")
'v(F(y), x) = Replace(v(F(y), x), Chr(13), "")
'v(F(y), x) = Replace(v(F(y), x), vbCrLf, "")
'v(F(y), x) = Replace(v(F(y), x), ChrW$(244), "")
'v(F(y), x) = Replace(v(F(y), x), Eliminate, "")
Next y
as you can see, the application.worksheetfunction.clean can identify the bad character in a cell formula (see above formula example), but cannot be used to produce a clean value (clean by removing paragraph mark)
Pulling my hair out shortly....
Last edited: