Hello All,
This macro worked great in Excel mac 2011 but does not work in the current version. It actually crashes Excel so it cant be debugged. It would print all the pages of each sheet in my workbook. Can some explain why it no longer works and how to fix it?
Sub prtme()
Dim Answer As VbMsgBoxResult
Answer = MsgBox("Are you sure!", vbOKCancel, "Print Workbook")
If Answer = vbOK Then
Dim cRng As Range
For Each cRng In Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row)
If cRng.Offset(0, 1).Value > 0 Then
Sheets(cRng.Value).PrintOut From:=1, To:=cRng.Offset(0, 1).Value, Copies:=1
End If
Next
End If
End Sub
Thank you!
Russ
This macro worked great in Excel mac 2011 but does not work in the current version. It actually crashes Excel so it cant be debugged. It would print all the pages of each sheet in my workbook. Can some explain why it no longer works and how to fix it?
Sub prtme()
Dim Answer As VbMsgBoxResult
Answer = MsgBox("Are you sure!", vbOKCancel, "Print Workbook")
If Answer = vbOK Then
Dim cRng As Range
For Each cRng In Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row)
If cRng.Offset(0, 1).Value > 0 Then
Sheets(cRng.Value).PrintOut From:=1, To:=cRng.Offset(0, 1).Value, Copies:=1
End If
Next
End If
End Sub
Thank you!
Russ