You can repeat for the number of sheets.
As an example, There is an Excel file with the following three sheets:
Option Explicit Sub sample() Dim ws As Worksheet For Each ws In ThisWorkbook.Worksheets 'output to "immediate window" Debug.Print ws.Name Next End Sub
You repeated for the number of sheets!
For more information about following, see the following official online manual: