View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default Move through the sheets of a workbook

What is the code to move through the sheets of a workbook one
by one and after processing the last sheet, stop?


Here is one way...

Sub TestCode3()
Dim WS As Worksheet
For Each WS In Worksheets
' Your code goes here in
' place of the following
WS.Range("A1") = WS.Name
Next
End Sub


Rick