run macro on all sheets in workbook after specific sheet

J

J.W. Aldridge

for all sheets that are after master data worksheet, run macro
"fildownid"

Sub loopthroughanddo()
x = Sheets("master data").Index
For Each sh In ThisWorkbook.Sheets
If sh.Index > x Then
Application.Run "fildownid"
End If
Next
End Sub
 
J

joel

Sub loopthroughanddo()
For Each sh In ThisWorkbook.Sheets
if Ucase(sh.name) <> "MASTER DATA" THEN
call fildownid
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top