I have several colums of data with names. The names are inputed in the
following way:
'daniel
'michael
'ted
how do i loop through the column and erase only the " ' " that is beginning
of each name?
Thank you
I have several colums of data with names. The names are inputed in the
following way:
'daniel
'michael
'ted
how do i loop through the column and erase only the " ' " that is beginning
of each name?
Thank you
Hi dstiefe,
You could try this. Note that it requires at least one cell in the target
column is selected.
Sub RemoveFirstChar()
' Removes the first character in a string value
' Requires that any cell(s) in the target column be selected
Dim c As Range
Dim lLastRow As Long, r As Long, iCol As Integer
iCol = Selection.Column
lLastRow = Cells(Rows.Count, iCol).End(xlUp).Row
For r = 1 To lLastRow
If Not IsEmpty(Cells(r, iCol)) Then
If Left$(Cells(r, iCol).Value, 1) = Chr$(39) Then _
Cells(r, iCol).Value = Mid$(Cells(r, iCol).Value, 2)
End If
Next
End Sub
Regards,
GS
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks