Nested with loops
- From: "Clair" <damnbrit@xxxxxxxxxxx>
- Date: 20 Mar 2006 09:48:18 -0800
Hi,
Not sure if anyone can explain why I'm getting a run time error '91'
(object variable or with block variable not set) when I try to run this
nested loop - I'm out of thoughts in trying to troubleshoot it. Any
thoughts would be greatly appreciated!
What I'm trying to - I have a large sheet of data and I'll need to
correct some formulas that occur in multiple columns and rows. So I
was just trying to loop through the appropriate columns and rows by
finding the appropriate ones, and correct each formula cell
individually.
Thanks! Clair.
With ActiveSheet.Columns(2)
Set c = .Find(What:=" Total", LookIn:=xlValues, LookAt:=xlPart)
If Not c Is Nothing Then
firstaddress = c.Address
Do
c.Select
With ActiveSheet.Rows("3:3")
Set d = .Find(What:="% Utilization", LookIn:=xlValues,
LookAt:=xlPart)
If Not d Is Nothing Then
dfirstaddress = d.Address
Do
d.Select
' loop actions here
Set d = .FindNext(d)
Loop While Not d Is Nothing And d.Address <>
dfirstaddress
End If
End With
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstaddress
End If
End With
.
- Follow-Ups:
- RE: Nested with loops
- From: Tom Ogilvy
- RE: Nested with loops
- Prev by Date: Re: Need Help with a MACRO
- Next by Date: Re: mark just cells containing data in a range
- Previous by thread: Import cells from excel into word and create multiple word docs
- Next by thread: RE: Nested with loops
- Index(es):
Relevant Pages
|