I'm trying to parse a file. All data is in Column A.
I'm trying to find the first occurance of a space. Select everything to the left of the space and then cut it out. The following bit of code works to find the space but I can't seem to select data to the left. Is this possible to do. When you run the recorder and select just a portion of the text in a cell then cut and paste, the code acts as though you selected the entire contents of the cell.
Option Explicit
Sub mytest()
Dim li_Location As Integer
Dim ls_CellVall As String
Dim ls_Addvalue As String
li_Location = 1
Range("A" & li_Location).Select
ls_CellVall = ActiveCell.Value
ls_Addvalue = InStr(1, ls_CellVall, " "
MsgBox ("The first blank is in position" & " " & ls_Addvalue)
End Sub
I'm trying to find the first occurance of a space. Select everything to the left of the space and then cut it out. The following bit of code works to find the space but I can't seem to select data to the left. Is this possible to do. When you run the recorder and select just a portion of the text in a cell then cut and paste, the code acts as though you selected the entire contents of the cell.
Option Explicit
Sub mytest()
Dim li_Location As Integer
Dim ls_CellVall As String
Dim ls_Addvalue As String
li_Location = 1
Range("A" & li_Location).Select
ls_CellVall = ActiveCell.Value
ls_Addvalue = InStr(1, ls_CellVall, " "
MsgBox ("The first blank is in position" & " " & ls_Addvalue)
End Sub