Ok, I just thought of something.....
in my case, I have 10 numeric characters, two vbLf characters, then 4
numeric characters, and then 3 more vbLf characters.
i.e.,
xxx-xxx-xxchr(10)chr(10)x.xxchr(10)chr(10)chr(10)
where the x, and hyphen, or dot are the elements I need to retain.
Would the replace look only at single vbLf's or does it look at ANY vbLf's,
and remove the?
"Rick Rothstein" wrote:
If you want to simply remove ALL of them, you can use the Replace function
like this...
v = Replace(ActiveCell.value, vbLf, " ")
where vbLf is a pre-defined VB constant for Chr(10), which is the Line Feed
character. Note I have replaced the Line Feed characters with a blank space,
otherwise the text on the two lines of text would end up butted next to each
other (last word of one line next to the first word of the line below it).
If you don't want to remove them all, then you need to tell us more about
how they are placed in your text (and how you want them to look afterwards)
so we can figure out which to remove and which to leave.
--
Rick (MVP - Excel)
"Steve" wrote in message
...
morning all.
I'm trying to clean out some extra spaces in my data.
Using AutoCAD 2009, I extracted some data into an excel spreadsheet.
(Autodesk has created a dataextraction tool for the latest version)
The data set that I'm trying to clean up has a bunch of chr(10) elements
in
it, and I'd like to remove them. Well, let me restate that-- there are
multiple blank space characters in the strings that I want to remove.
I've tried trim, but it appears to be treating the chr(10) elements as
valid
string components. I've also tried right() and it too is picking up the
chr(10) elements.
How can I clean the chr(10) elements out?
Here's my present code (It's something I got from Gary's Student either
late
last year, or earlier this year, and made one modification to-- adding
trim)--
Dim v As String, val As Double
While ActiveCell.value < ""
v = ActiveCell.value
v = Trim(v)
val = Right(v, 4)
ActiveCell.Offset(0, 1).value = val
ActiveCell.Offset(1, 0).Select
Wend
Thank you for your helps.