K
KR
I wanted to test to see if the Trim function would also take off any extra
chr(10)'s because I'm concatenating strings within cells and have to line up
my information with adjacent cells- but I sometimes end up with an extra
chr(10) at either the beginning or end of the cell, and I was looking for an
easy way to remove it.
I wrote the following to test to see if Trim would work (or if it only works
on regular extra spaces). The first several times I got an 'out of memory'
error, so I rebooted, and from a clean boot, tried again, and it ended up
taking over by hogging loads of memory -at least I don't have any other
explanation, since nothing else was running on the PC, and when I hard
exited Excel via the task manager my memory opened back up.
So, here's my question- why would this one line of code cause Excel to
"freak out"? Or do I have something else going on that I'm mis-attributing
to Excel? XL2003 on Win2000.
Test at your own risk :\
Sub testTrim()
Sheet4.Range("B2").Value = Trim(Str("hhh" & Chr(10)))
End Sub
chr(10)'s because I'm concatenating strings within cells and have to line up
my information with adjacent cells- but I sometimes end up with an extra
chr(10) at either the beginning or end of the cell, and I was looking for an
easy way to remove it.
I wrote the following to test to see if Trim would work (or if it only works
on regular extra spaces). The first several times I got an 'out of memory'
error, so I rebooted, and from a clean boot, tried again, and it ended up
taking over by hogging loads of memory -at least I don't have any other
explanation, since nothing else was running on the PC, and when I hard
exited Excel via the task manager my memory opened back up.
So, here's my question- why would this one line of code cause Excel to
"freak out"? Or do I have something else going on that I'm mis-attributing
to Excel? XL2003 on Win2000.
Test at your own risk :\
Sub testTrim()
Sheet4.Range("B2").Value = Trim(Str("hhh" & Chr(10)))
End Sub