Pausing a Print macro and fixing print range

Mabocat

Board Regular
Joined
Apr 20, 2011
Messages
74
OK have a print macro that works well and combined it with Post #12 from
https://www.mrexcel.com/forum/excel-questions/39788-old-excel-macro-language-2.html
with a slight modification.

This is it from my spreadsheet
Code:
 Application.Wait (Now + TimeValue("0:00:20"))
    Application.Goto Reference:="Tawnton_print"
    ActiveSheet.PageSetup.PrintArea = "[COLOR=#ff0000]$A$1:$L$51[/COLOR]"
    ActiveWindow.SelectedSheets.PrintOut From:=2, To:=2, Copies:=2, Collate _
        :=True, IgnorePrintAreas:=False
    Range("A1").Select
End Sub

What I would like it to do is not only wait or pause, but bring up a Message box with the Words "Reload Tawnton pages" with a OK button so once I have physically re-loaded the pages ( which are on the reverse side of previously printed pages), pressing return key or clicking on the OK button, the macro continues to process & print.

I also new to amend the text colour red words to be "Tawnton_print" range as this could vary from A1:L51 to A1: L40 or A1:L60

previous advice has been to use CurrentRegion.Select but not sure where is goes in the above coding

Ron
 
Last edited:

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
I managed to find out about a message box using MsgBox and removed the
Application.Wait (Now + TimeValue("0:00:20"))

works well
 
Upvote 0
So a question re range variations

I have this instruction
Code:
ActiveSheet.PageSetup.PrintArea = "$A$1:$L$51"

but because the range could change even though it was first selected like this
Code:
Application.Goto Reference:="Tawnton_print"

it seems to me after some testing that this will do the trick to allow for increase/decrease in the actual range after the Goto instrcution
Code:
Selection.CurrentRegion.Select

so instead of this
Code:
Application.Goto Reference:="Tawnton_print"
    ActiveSheet.PageSetup.PrintArea = "$A$1:$L$51"
    ActiveWindow.SelectedSheets.PrintOut From:=2, To:=1, Copies:=2,

it will be this
Code:
Application.Goto Reference:="Tawnton_print"
    Selection.CurrentRegion.Select
    ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1,


is this the best way of handling possible actual range variations ?

Ron
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,248
Members
452,623
Latest member
cliftonhandyman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top