Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
problem with test to columns feature identifying odd delimiting character | Excel Discussion (Misc queries) | |||
Identifying the presence of a randomly ordered text string in a cell | Excel Worksheet Functions | |||
Excel-Match 1st text character in a string to a known character? | Excel Worksheet Functions | |||
identifying a string of positive numbers | Excel Worksheet Functions | |||
Function to return Character Position of Xth character within a string | Excel Programming |