Iterating through Excel sheets

excel, excel-2010, vba

Solution

Try this (this will simply activate each sheet):

Sub spellCheck()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
    ws.Activate
    ' Do stuff...
Next
End Sub

Problem

Here is my code. I'm new to VBA so, I am unsure how to iterate through multiple pages. Here's my code: ``` Dim ws As Worksheet Sub spellCheck() For Each ws In ActiveWorkbook.Worksheets Cells.CheckSpelling Next End Sub ```

Original source