Sub insert()
Dim r As Range
Dim rd As Range
Set r = Range("H2")
Do While Not IsEmpty(r)
Set rd = r.Offset(1, 0)
If r.Offset(0, -1) = "Cash Deposits*" Then
r.insert Shift:=xlToRight
End If
Set r = rd
Loop
End Sub
Above macro is not working on e.gCells containing Cash Deposits Euro100 or
Cash Deposits USD 1000
Can someone pls correct my macro thxs
JLGWhiz - 10 Nov 2007 00:19 GMT
You might have to use the Like operator.
If r.Offset(0, -1) Like "Cash Deposits*" Then
> Sub insert()
> Dim r As Range
[quoted text clipped - 12 lines]
> Cash Deposits USD 1000
> Can someone pls correct my macro thxs