ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Create command button to print multiple worksheets in a excel file (https://www.excelbanter.com/excel-discussion-misc-queries/81760-create-command-button-print-multiple-worksheets-excel-file.html)

MarcoR

Create command button to print multiple worksheets in a excel file
 
I have never worked with a macro in excel.
I have a file with 5 worksheets.
I want to create a command button in Worksheet 1 so I can print worksheets 2
through 4 all together.
Please help.

Marco

Ron de Bruin

Create command button to print multiple worksheets in a excel file
 
You can use a one liner to do this (array)
http://www.rondebruin.nl/print.htm#Print

--
Regards Ron de Bruin
http://www.rondebruin.nl


"MarcoR" wrote in message ...
I have never worked with a macro in excel.
I have a file with 5 worksheets.
I want to create a command button in Worksheet 1 so I can print worksheets 2
through 4 all together.
Please help.

Marco




jd1

Create command button to print multiple worksheets in a excel
 
I have tried the sheets array code, but I keep getting an error "Runtime
error 9: Sub-script out of range." Any recommendations?

"Ron de Bruin" wrote:

You can use a one liner to do this (array)
http://www.rondebruin.nl/print.htm#Print

--
Regards Ron de Bruin
http://www.rondebruin.nl


"MarcoR" wrote in message ...
I have never worked with a macro in excel.
I have a file with 5 worksheets.
I want to create a command button in Worksheet 1 so I can print worksheets 2
through 4 all together.
Please help.

Marco





Gord Dibben

Create command button to print multiple worksheets in a excel
 
That could indicate that you don't have one or more of the sheets in the array.

Check the spelling on the sheetnames and in your macro.


Gord Dibben MS Excel MVP

On Mon, 26 Jun 2006 09:59:01 -0700, jd1 wrote:

I have tried the sheets array code, but I keep getting an error "Runtime
error 9: Sub-script out of range." Any recommendations?

"Ron de Bruin" wrote:

You can use a one liner to do this (array)
http://www.rondebruin.nl/print.htm#Print

--
Regards Ron de Bruin
http://www.rondebruin.nl


"MarcoR" wrote in message ...
I have never worked with a macro in excel.
I have a file with 5 worksheets.
I want to create a command button in Worksheet 1 so I can print worksheets 2
through 4 all together.
Please help.

Marco







All times are GMT +1. The time now is 10:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com