Macro Recorder

P

pitcher1

I have produced a 35 page workbook and want to assign a button on page
1 which when pressed would e-mail a PDF file. I have used the macro
recorder, which recorded the following:
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("Invoice 1").Select
ActiveWindow.SelectedSheets.PrintOut:
The macro works fine and does exactly what I want until I save and
quit Excel. Then when re-opened the macro just prints a single copy of
the page in question.
 
C

Carl Witthoft

I have produced a 35 page workbook and want to assign a button on page
1 which when pressed would e-mail a PDF file. I have used the macro
recorder, which recorded the following:
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("Invoice 1").Select
ActiveWindow.SelectedSheets.PrintOut:
The macro works fine and does exactly what I want until I save and
quit Excel. Then when re-opened the macro just prints a single copy of
the page in question.

It's not clear why that macro ever printed all the sheets. But I'd dig
around in the Macro help files until you find the name to use for all
the sheets -- it'll probably look something like

Sheets.Range.All.Select
 
L

Laroche J

I have produced a 35 page workbook and want to assign a button on page
1 which when pressed would e-mail a PDF file. I have used the macro
recorder, which recorded the following:
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("Invoice 1").Select
ActiveWindow.SelectedSheets.PrintOut:
The macro works fine and does exactly what I want until I save and
quit Excel. Then when re-opened the macro just prints a single copy of
the page in question.

Assuming you want to print all sheets of the workbook, you can get the
desired result with simply:

Sheets.Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1

JL
Mac OS X 10.4.10, Office v.X 10.1.9
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top