Hi,
I am using this macro to print selected sheets from a workbook with 229 sheets.
It should only print the sheets with qualifying data in two specific cells. It worked perfectly for about 2 weeks. I went home on Tuesday and everything was fine, came back on Thursday and I am getting a runtime 13 miss match error.
Any thoughts?
Sub macroprint()
Dim Sh As Worksheet
Dim Arr() As String
Dim N As Integer
N = 0
For Each Sh In ActiveWorkbook.Worksheets
If Sh.Visible = xlSheetVisible And Sh.Range("E1").Value > "40544" And Sh.Range("C2").Value <> "Occupied" Then
N = N + 1
ReDim Preserve Arr(1 To N)
Arr(N) = Sh.Name
End If
Next
If N = 0 Then
MsgBox "No Vacant Dirty", vbExclamation
Exit Sub
End If
With ActiveWorkbook
.Worksheets(Arr).PrintOut
End With
End Sub
Thank you
Bookmarks