Hi all,
I'm new with VB and tried for a long time to find the answer on different forums. Since I didn't find anything I decide to post it.
I would like to do a simple text to column. I have a lot of rows in column A. Problem is that with the following code the text to column only works for cell A1. I wish it could work for all the "non blank" cells of column A. This is the VBA code I have:
Private Sub CommandButton1_Click()
NewFN = Application.GetOpenFilename(FileFilter:="All Files (*.), *.", Title:="Please select a file")
If NewFN = False Then
' They pressed Cancel
MsgBox "Stopping because you did not select a file"
Exit Sub
Else
Workbooks.Open Filename:=NewFN
End If
Selection.TextToColumns Destination:=Range("A:A"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar:=";", FieldInfo:=Array(1, 1)
End Sub
Thanks and regards,
Simon
Bookmarks