How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Richard Your Own Question

Richard
Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 32042
Experience:  Over 15 year experience resolving Microsoft Office Issues
32989067
Type Your Microsoft Office Question Here...
Richard is online now
A new question is answered every 9 seconds

I want a macro so that I can print multiple pages (with a specific

This answer was rated:

I want a macro so that I can print multiple pages (with a specific range on each page) on my workbook by pressing a button on the 1st page. Excel 2007
Thank you for your question, my name is Richard.

This is the Macro you would use

Sub mPrint()

Sheet("sheet2").Select
Range("A2:F15").Select
ActiveSheet.PageSetup.PrintArea = "A2:F15"
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True

end sub

You replace sheet name and range with the values you wish.

If you have any difficulties at all, please do not hesitate to let me know so I can assist you further

Thank you

Customer: replied 3 years ago.

The macro:


Sheet("Cover").Select


Range(B1:I59).Select


ActiveSheet.PageSetup.PrintArea = "B1:I59"


ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate_:=True


 


 


End Sub


Has an error: "Compile error: Sub or Function not defined with "Sheet" being highlited"

You forgot the " on this

Range(B1:I59).Select

It needs to be

Range("B1:I59").Select
Customer: replied 3 years ago.

Still not working


Have uploaded workbook: File ID 617016


 


Pse add the first 2 pages with any range, I will do the rest


 


Thank you


 

Fixed Mick

you can download it under File ID: 930724

Let me know if you have any difficulties please

Customer: replied 3 years ago.

I tried to add a another page and range but was unsuccesfull


What do I need to change on this:


 


Sub mPrint()


 


Sheets("Cover,Info").Select


Range("B1:I59,B3:J46").Select


ActiveSheet.PageSetup.PrintArea = "B1:I59,B3:J46" ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1


 


End Sub

You cannot make the range twice in one command like what you do below

Range("B1:I59,B3:J46").Select

You need to do one sheet at a time.

So it would be


Sub mPrint()



Sheets("Cover,Info").Select

Range("B1:I59").Select

ActiveSheet.PageSetup.PrintArea = "B1:I59,B3:J46" ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1


Sheets("Cover,Info").Select

Range("B3:J46").Select

ActiveSheet.PageSetup.PrintArea = "B1:I59,B3:J46" ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1


End Sub
Customer: replied 3 years ago.

I'm sorry if I don't understand.


My 1st page is "Cover" the 2nd "Info".The macro underneath prints the 1st page but not the second, it also has Visual Basic 400 error?


 


Sub mPrint()


 


Sheets("Cover").Select


Range("B1:I59").Select


ActiveSheet.PageSetup.PrintArea = "B1:I59" ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1


 


Sheets("Info").Select


Range("B3:J46").Select


ActiveSheet.PageSetup.PrintArea = "B3:J46" ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1


 


End Sub

I did it for you here Mick

File ID: 384042

Let me know if you have any difficulties please

Richard and other Microsoft Office Specialists are ready to help you