J
jacqui
I've got myself in a bit of a muddle with a Do Loop in
that I've created a bit of an endless cycle. My code is
as follows, it worked fine until I added c.Offset(2,0),
previously it was just c.Resize(1) etc, and now the c.Row
<> firstrow is out of sync so it doesn't know when to stop
and ends up repeating the loop again. Can anyone help?
In fact Tom are you on-line this afternoon 'cause you
kindly helped me with this original code.
Many thanks
Jacqui
Set c = .Find("Other", LookIn:=xlValues, MatchCase:=False)
If Not c Is Nothing Then
firstrow = c.Row
i = 0
Do
i = i + 1
c.Offset(2, 0).Resize
(1).EntireRow.Insert
If i = 1 Then firstrow = firstrow + 1
Set c = .FindNext(c)
Loop While c.Row <> firstrow
End If
that I've created a bit of an endless cycle. My code is
as follows, it worked fine until I added c.Offset(2,0),
previously it was just c.Resize(1) etc, and now the c.Row
<> firstrow is out of sync so it doesn't know when to stop
and ends up repeating the loop again. Can anyone help?
In fact Tom are you on-line this afternoon 'cause you
kindly helped me with this original code.
Many thanks
Jacqui
Set c = .Find("Other", LookIn:=xlValues, MatchCase:=False)
If Not c Is Nothing Then
firstrow = c.Row
i = 0
Do
i = i + 1
c.Offset(2, 0).Resize
(1).EntireRow.Insert
If i = 1 Then firstrow = firstrow + 1
Set c = .FindNext(c)
Loop While c.Row <> firstrow
End If