Search code examples
characterexcel-2010alphanumeric

Delete first two characters of an alphanumeric sequence in a column


I'm trying to scan a column for character size. If the alphanumerical character size is met (qty 12), then the first two characters will be deleted. They will always be specific numbers (10). See below.

H063088955
F243066424
10G403085387
F253066457
E473057375
G503087343
10H303098124
G093075912
G433084322
10G403085388

Solution

  • Select the cells you wish to process and run:

    Sub qwerty()
        For Each r In Selection
            v = r.Text
            If Len(v) = 12 Then
                r.Value = Mid(v, 3)
            End If
        Next r
    End Sub