Looping

  • Thread starter Thread starter Gusset Gadder
  • Start date Start date
G

Gusset Gadder

How do I perform the same set of command/functions on every worksheet in the
workbook without having to specify the worksheet names.
Must also work if I add or remove a sheet.

Thank you
 
Hi Gusset

Dim sh as Worksheet
For Each sh In ThisWorkbook.Worksheets
'your code
Next sh
 
Ron de Bruin said:
Hi Gusset

Dim sh as Worksheet
For Each sh In ThisWorkbook.Worksheets
'your code
Next sh


Brilliant !!

Thank you so much
 

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

Back
Top