Nested with loops

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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

.



Relevant Pages

  • RE: Nested with loops
    ... Dim dfirstaddress As String ... Dim firstaddress As String ... Loop While Not d Is Nothing And d.Address dfirstaddress ...
    (microsoft.public.excel.programming)
  • Re: Add Data to a file during each iteration
    ... I am trying to run a "for loop" to find ... the binary equivalent of decimal numbers. ... It wasn't clear to me from your post, whether you wanted to write the same entry dec2binacross multiple columns, or you had in mind an array with a single column. ...
    (comp.soft-sys.matlab)
  • PHP & MySQL
    ... If I have a select statement where I select multiple columns from a ... table and I'm only returning 1 row, there is no need for me to loop. ... values with one query statement? ...
    (php.general)
  • Re: Search engin
    ... Private Sub find ... Loop While Not c Is Nothing And c.Address firstAddress ... MsgBox "Please note that there are no more entries avaliable" ...
    (microsoft.public.excel.programming)
  • RE: loops
    ... I have the following piece of code which checks the customer and product ... I have now realised that I need to enter a qty for price breaks so the loop ... Loop While Not C Is Nothing And C.Address firstAddress ...
    (microsoft.public.excel.programming)