L
LizS
Hi all
I have a macro that sets two print ranges and prints them. If I step
through the macro it works fine. If I run the macro it sets the print
ranges but doesn't print. It seems to run too quickly. I have tried
slowing the macro down but to no avail. Can anyone help?
Thanks
Regards
Liz
Macro:
Sub PrintSearch()
ActiveSheet.PageSetup.PrintArea = "$a$1:$b$50"
ActiveSheet.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = "$c$1:$f$50"
ActiveSheet.PrintOut Copies:=1, Collate:=True
End Sub
Slowed down version (in theory):
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub PrintSearch()
ActiveSheet.PageSetup.PrintArea = "$a$1:$b$50"
Sleep 2500
ActiveSheet.PrintOut Copies:=1, Collate:=True
Sleep 2500
ActiveSheet.PageSetup.PrintArea = "$c$1:$f$50"
Sleep 2500
ActiveSheet.PrintOut Copies:=1, Collate:=True
End Sub
I have a macro that sets two print ranges and prints them. If I step
through the macro it works fine. If I run the macro it sets the print
ranges but doesn't print. It seems to run too quickly. I have tried
slowing the macro down but to no avail. Can anyone help?
Thanks
Regards
Liz
Macro:
Sub PrintSearch()
ActiveSheet.PageSetup.PrintArea = "$a$1:$b$50"
ActiveSheet.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = "$c$1:$f$50"
ActiveSheet.PrintOut Copies:=1, Collate:=True
End Sub
Slowed down version (in theory):
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub PrintSearch()
ActiveSheet.PageSetup.PrintArea = "$a$1:$b$50"
Sleep 2500
ActiveSheet.PrintOut Copies:=1, Collate:=True
Sleep 2500
ActiveSheet.PageSetup.PrintArea = "$c$1:$f$50"
Sleep 2500
ActiveSheet.PrintOut Copies:=1, Collate:=True
End Sub