Grab the Free VBA Quick Reference Guide
[ Ссылка ]
Macro to Loop Through All Worksheets in a Workbook. We use a for each worksheet in worksheets to loop through each sheet in a workbook.
Code:
=================
Sub SheetLoop()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Cells(2, 5) = "Does this work"
ws.Activate
Debug.Print ws.Name
Next
End Sub
![](https://i.ytimg.com/vi/3OfVIsKy59c/maxresdefault.jpg)