Miracle Workers,
I have a code here... that I'm pretty sure I got from one of you wizards that has been serving its purpose flawlessly. However, My workbook has grown and I now need to amend the code.
here is the code I have
Sub Print_1st()
Dim vShts As Variant
vShts = Sheets(1).Range("A2")
If Not IsNumeric(vShts) Then
Exit Sub
Else
Select Case vShts
Case 1
Sheets("Run 1").PrintOut
Case 2
Sheets("Run 1").PrintOut
Sheets("Run 2").PrintOut
Case 3
Sheets("Run 1").PrintOut
Sheets("Run 2").PrintOut
Sheets("Run 3").PrintOut
Case 4
Sheets("Run 1").PrintOut
Sheets("Run 2").PrintOut
Sheets("Run 3").PrintOut
Sheets("Run 4").PrintOut
End Select
End If
End Sub
It works exactly as needed when the tabs are open. My book has grown by leaps and bounds and its now necessary to keep those sheets "Run 1", "Run 2" etc, I'm wanting printed in each case hidden. If I hide these sheets the code breaks and I get no printout. it stalls on whichever sheet it comes across first that is hidden.
Can I get this updated to open the sheet needed then print it, and hide the sheet again. I have no need to see the sheet myself on screen, and I'd like to make sure I end up on whichever sheet I ran the macro from.
Please and thank you.
Bookmarks