PDA

View Full Version : Solved: splitting text at Hyphen



kevvukeka
05-30-2013, 12:18 AM
Hi All,

At one point in my code I have to split a selected range at hyphen into another column. I used the below code, but it doesn't have any effect on the range. can someone help plz?




Range("A2:A" & j).Select
Selection.TextToColumns
Destination:=Range("A2"), DataType:=xlDelimited, OtherChar
_
:="-"

p45cal
05-30-2013, 03:14 AM
you'll need
Other:=True
too.

mancubus
05-30-2013, 04:44 AM
hi kevvukeka...

you dont need to select the range...


Range("A2:A" & j).TextToColumns Destination:=Range("A2"), Other:=True, OtherChar:="-"

kevvukeka
05-31-2013, 04:24 AM
Hi p45cal & mancubus,

Thanks a lot for your help....

mancubus
05-31-2013, 05:00 AM
you're welcome...