1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Sub text2()
With Worksheets(1).Range("b2:b4")
Set c = .Find(="Weekend", lookin:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.offset(0,1) = "Weekend"
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
With Worksheets(1).Range("b2:b4")
Set c = .Find(="Day Ahead", lookin:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.offset(0,1) = "Day Ahead"
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
end sub |