Reputation: 21
The below is for putting numbers before each word. Is there any same formula to remove the numbers from beginning of each word in spreadsheet. This is the link of formula how to insert numbers before every word in excel
Sub test()
Dim cl As Range, i&
Set cl = Cells.Find("*")
For i = 1 To WorksheetFunction.CountA(Cells)
If Not cl Is Nothing Then
cl.Value2 = i & "/" & cl.Value2
Set cl = Cells.FindNext(cl)
Else
Exit For
End If
Next i
End Sub
Upvotes: 0
Views: 81
Reputation: 537
use the same code but instead of inserting the number remove it by
Sub test()
Dim cl As Range, i&
Set cl = Cells.Find("*")
For i = 1 To WorksheetFunction.CountA(Cells)
If Not cl Is Nothing Then
cl.Value2 = RIGHT(cl.Value2,LEN(cl.Value2)-InStr(cl.Value2, "/")-1)
Set cl = Cells.FindNext(cl)
Else
Exit For
End If
Next i
End Sub
Upvotes: 2