Hello,
I have created a macro that loops through and creates an array of the visible sheets. Now I would like for it to print each of those sheets out. I think my main mistake is in my declaration of the array type, since I have not worked with arrays much before.
Please help me figure out how to make the following code operable. Currently when I run it I'm getting a "Run-time error (9): Subscript out of range" error.
Dim reference As Worksheet
Dim outputsheets() As String
Dim i As Integer
Sub printing()
'
Sheets("Review").Select
i = 0
For Each reference In Sheets
If reference.Visible = True Then
outputsheets(i) = reference.Name
i = i + 1
End If
Next
ReDim Preserve outputsheets(i)
Sheets(outputsheets()).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub
Thanks!
Bookmarks