View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
excelent excelent is offline
external usenet poster
 
Posts: 695
Default Execute macro many times??

Sub MakeMyDay()

Dim r, rloop

Sheets("Order 3").Activate
r = Cells(65500, 1).End(xlUp).Row - 10
Cells(11, 9).Activate
For rloop = 1 To r
Call FindRoot
ActiveCell.Offset(1, 0).Activate
Next

For Each r In Range("W11:w160")
Call FindRoot
Next

Sheets("Lookup").Activate
r = Cells(65500, 9).End(xlUp).Row - 12
Cells(13, 9).Activate
For rloop = 1 To r
If IsNumeric(Cells(rloop, 2)) Then
Call FindRoot
Cells(rloop, 9).Activate
Next

Sheets("Compare").Activate
Cells(11, 6).Activate
xloop:
If Cells(11 + x, 5) < "Max Exceeded" Then
Call FindRoot
x = x + 1
GoTo xloop
End If


End Sub