Macro Assistance (Remove First number)

Closed
z - Apr 21, 2010 at 11:35 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Apr 21, 2010 at 05:55 PM
I have an excel speadsheet that is sent to me daily with numbers
in column A (example: 1.1.2.1.1). What I have to do everyday
is delete the first 1. to make it look like (1.2.1.1).
Do anyone know if it is a macro that can do this for me to save time because I normally have about 300 to do daily? If so, please show an example.

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Apr 21, 2010 at 05:55 PM
Try this


Sub RemoveFirstPeriod()


Dim lMaxRows As Long
Dim vTemp As Variant

    lMaxRows = Cells(Rows.Count, "A").End(xlUp).Row
    
    For RowCount = 1 To lMaxRows
        vTemp = vbNull
        
        vTemp = InStr(1, Range("A" & RowCount), ".")
        
        If vTemp > 0 Then
        
            Range("A" & RowCount) = Mid(Range("A" & RowCount), vTemp + 1)
        End If
        
    Next RowCount
End Sub
0