Topic: | Re:Re:Re:Excel - removing words at start of cell - replace can't do it | |
Posted by: | Will Watson | |
Date/Time: | 18/03/15 16:04:00 |
Well, it would not be my first thought but here you go: Sub Georgie() Dim r As Integer, c As Integer, s As String Dim ws As Worksheet Set ws = ActiveSheet ' first row r = 1 ' col to be thrutched c = 1 s = ws.Cells(r, c) While s <> "" If Left(s, 9) = "butternut" Then s = Mid(s, 10, 999) Else If Left(s, 6) = "peanut" Then s = Mid(s, 7, 999) Else s = s End If End If ws.Cells(r, c).Formula = s r = r + 1 s = ws.Cells(r, c) Wend End Sub |