I used the following code to print a hidden sheet and my first sheet disappeared .......can anyone tell me what the problem was, please
TIA
GT
Sub PrintOnlyHiddenWorksheets()
Dim CurVis As Long
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
With sh
CurVis = .Visible
If CurVis >= 0 Then
.Visible = xlSheetVisible
.PrintOut
.Visible = CurVis
End If
End With
Next sh
End Sub
TIA
GT
Sub PrintOnlyHiddenWorksheets()
Dim CurVis As Long
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
With sh
CurVis = .Visible
If CurVis >= 0 Then
.Visible = xlSheetVisible
.PrintOut
.Visible = CurVis
End If
End With
Next sh
End Sub