![]() |
identifying the first character in a string
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 |
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 |
All times are GMT +1. The time now is 09:48 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com