I am trying to extract phone numbers from Columns A:E, and place them in Columns F:I. "The provided example is an instance on Col"E"".
I would like the phone numbers extracted to Columns F:I. However, if a column already has data. Then move onto the next, using that last "I" Column as the final location should the data have 4 numbers "It will never be greater than 4"
Dim c As Range, i As Integer
For Each c In Worksheets("data").Range("B2", _
Worksheets("data").Range("B" & Rows.Count).End(xlUp))
With c
If .Value2 Like "*???-???-????*" Then
For i = 11 To 14
If .Offset(, i).Value2 = "" Then
.Offset(, i).Value2 = .Value2
.Value2 = ""
GoTo NextC
End If
Next i
End If
End With
NextC:
Next c
End sub
The problem I am having is it only returns some of the phone numbers and not all of them. "98k rows"
The data is from an old XML file that I extracted. On a specific "Name" column from the extraction, I had replaced the carriage return code with a unique symbol, I then used that unique symbol to run a text to columns. It provided key "Name" data from A:N. {example: Customer names, email address, cell phones, home phone, item details, street address, city, zip...} Now each one of those columns could very well hold phone number data that I would like extracted in 4 separate columns "most likley F:I", but also keeping the logic that as the phone columns fill up, it doesnt overwrite and moves on to the next available column from the 4 I designated.
changed
If .Value2 Like "*???-???-????*" Then
to
If .text Like "*###-###-####*" Then
Success.