I can't seem to find the right combination on this one.
I need to pass the sheet name to another Sub called SetCF. If I'm using the next ws syntax, can I just pass the ws name without having to qualify it with the Set statement? I cut out all the stuff that isn't important in the second sub.
Code
- Sub DoStuff()
- Dim ws As Worksheet
- Application.ScreenUpdating = True
- For Each ws In ActiveWorkbook.Worksheets
- If Left(ws.Name, 1) = "Q" Then
- Dim mySheet As Worksheet: Set mySheet = Sheets(ws.Name)
- Call SetCF(mySheet)
- ws.Visible = xlSheetVeryHidden
- End If
- Next ws
- Application.ScreenUpdating = True
- End Sub