Macro Assistance (Remove First number) [Closed]

Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
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 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
767
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

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!