identifying the first character in a string
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
|