Using VB in Exce, can I loop through all worksheets?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to find a VB function that will allow me to run a macro through
all worksheets in an Excel file? I am using an Excel file with 500
worksheets. What is the VB command that will cycle through all worksheets in
this Excel file?

Thanks!!
 
Dim WS As Worksheet
For Each WS In ActiveWorkbook.Worksheets
' do your stuff
Next

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 

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