Question for Jim Thomlinson
That code is just fine. At no point does it rely on the tab name of the
sheets in your workbook.
In the excel object hierarchy there is the Worksheet object and the
Worksheets collection (note the s in the latter object). What your code is
doing is it is taking a worksheet object and using that to traverse the
worksheets collection. At no time are you refering to the sheets by their tab
name which is dangerous since user have access to change the tab names.
--
HTH...
Jim Thomlinson
"Brad" wrote:
Thank you for pointing out that I should use the code name - rather than tab
name - how would the following code be change to use code name - rather than
tab name?
Sub Print_pages()
Dim sht As Worksheet
For Each sht In Worksheets
If sht.Name < "Input" And sht.Visible = True Then
sht.PrintOut
End If
Next
End Sub
|