S
StargateFanFromWork
I have a PRINT ALL macro with button on a sheet. There are 2 other print
macros each filtering the data by 2 criteria. The 3rd, however, is to print
the entire worksheet without filters and I put the ShowAllData code at the
beginning before doing the sort and bringing up the print dialogue box:\
ActiveSheet.ShowAllData
Application.Goto Reference:="R1C4"
Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Key2:=Range("C2")
_
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=
_
False, Orientation:=xlTopToBottom
Range("B2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Application.Dialogs(xlDialogPrint).Show
If the data is already in ShowAll mode, I get the usual 1004 error:
"Run-time error '1004':
ShowAllDate method of Worksheet class failed"
while the entire macro works fine if the sheet is filtered. How can I get
around the problem when it happens to _already_ show all the data, pls?
Thank you!
macros each filtering the data by 2 criteria. The 3rd, however, is to print
the entire worksheet without filters and I put the ShowAllData code at the
beginning before doing the sort and bringing up the print dialogue box:\
ActiveSheet.ShowAllData
Application.Goto Reference:="R1C4"
Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Key2:=Range("C2")
_
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=
_
False, Orientation:=xlTopToBottom
Range("B2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Application.Dialogs(xlDialogPrint).Show
If the data is already in ShowAll mode, I get the usual 1004 error:
"Run-time error '1004':
ShowAllDate method of Worksheet class failed"
while the entire macro works fine if the sheet is filtered. How can I get
around the problem when it happens to _already_ show all the data, pls?
Thank you!