I have this code below to change delimited comma text to specific columns with a command button. It works great.
When I want to copy and paste another example in A1, the data is not correct. It seems to be already formatted but in the wrong column.
I can't find a way to fix it other than to close and re-open. Any suggestions to fix this?
Private Sub CommandButton1_Click()
Dim objRange1 As Range
'Set up the ranges
Set objRange1 = Range("a23:a49")
'Do the first parse
objRange1.TextToColumns _
Destination:=Range("e2"), _
DataType:=xlDelimited, _
Tab:=False, _
Semicolon:=False, _
Comma:=True, _
Space:=False, _
Other:=False, _
OtherChar:="-"
End Sub
When I want to copy and paste another example in A1, the data is not correct. It seems to be already formatted but in the wrong column.
I can't find a way to fix it other than to close and re-open. Any suggestions to fix this?
Private Sub CommandButton1_Click()
Dim objRange1 As Range
'Set up the ranges
Set objRange1 = Range("a23:a49")
'Do the first parse
objRange1.TextToColumns _
Destination:=Range("e2"), _
DataType:=xlDelimited, _
Tab:=False, _
Semicolon:=False, _
Comma:=True, _
Space:=False, _
Other:=False, _
OtherChar:="-"
End Sub