Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks both for the help on this one. Never heard of trim before. Very
useful. Happy New Year "Sharad Naik" wrote: Instead of LTrim(RTrim(mystring)) you can use simply Trim(mystring) Sharad "tcbootneck" wrote in message ... Thank you, gave me a steer. The code didn't like the link to application, so looked up trim in vba help. Code I've now come up with looks like. Sub trim_left() Dim mystring, trimstring Range("H3").Activate mystring = ActiveCell trimstring = LTrim(RTrim(mystring)) Range("i3") = trimstring End Sub with the value of ' 123456 in h3. Many thanks "tcbootneck" wrote: I am trying to import data where there is sometimes a blank in the cell before the data - space bar. I need to get the VBA code to do something like "If left character is blank then delete left character and move ramining chaacters to the left" Tried a few different ways in VBA, but none seem to do the trick |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HOW DO I EXTRACT ALL CHARACTERS AFTER 5 CHARACTERS ON LEFT | Excel Worksheet Functions | |||
removing everything from the left after 10 digits | Excel Worksheet Functions | |||
Removing blank characters ? | Excel Discussion (Misc queries) | |||
Removing characters from datetime field | Excel Discussion (Misc queries) | |||
Copying and pasting a worksheet to a blank and removing blank rows | Excel Programming |