Looping through Worksheets

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

Guest

I'm looking for the syntax for a procedure that would loop through all
worksheets in the active workbook, list the name of the worksheet and the
contents of cell A3 for each worksheet.

Can someone help? Thanks!
 
for each sh in Activeworkbook.Worksheets
With thisworkbook.Worksheets(1).Cells(i,1)
.Value = sh.name
.offset(0,1).value = sh.Range("A3").Value
end with
Next
 

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