ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing (https://www.excelbanter.com/excel-programming/343391-printing.html)

Brent

Printing
 
I am trying to complete a macro that is linked to a button to print multiple
sheets from a workbook. The macro is intended to read a number from the
first sheet to determine how many sheets to print. This should be a short
program, but How would I write a for loop to access a different sheet each
time. This is what I have

For Coun = 1 To Vio_Num

Sheets("?").PageSetup.PrintArea = "$A$1:$L$45"


The ? is where I need the incementing value to go. Is this possible?

Jim Rech

Printing
 

Sheets(Coun).PageSetup.PrintArea = "$A$1:$L$45"


--
Jim
"Brent" wrote in message
...
|I am trying to complete a macro that is linked to a button to print
multiple
| sheets from a workbook. The macro is intended to read a number from the
| first sheet to determine how many sheets to print. This should be a short
| program, but How would I write a for loop to access a different sheet each
| time. This is what I have
|
| For Coun = 1 To Vio_Num
|
| Sheets("?").PageSetup.PrintArea = "$A$1:$L$45"
|
|
| The ? is where I need the incementing value to go. Is this possible?



Tom Ogilvy

Printing
 
Sub AAAA()
Vio_Num = 3
For Coun = 1 To Vio_Num
Sheets(Coun).Activate
ActiveSheet.PageSetup.PrintArea = "$A$1:$L$45"
Next

End Sub


--
Regards,
Tom Ogilvy

"Brent" wrote in message
...
I am trying to complete a macro that is linked to a button to print

multiple
sheets from a workbook. The macro is intended to read a number from the
first sheet to determine how many sheets to print. This should be a short
program, but How would I write a for loop to access a different sheet each
time. This is what I have

For Coun = 1 To Vio_Num

Sheets("?").PageSetup.PrintArea = "$A$1:$L$45"


The ? is where I need the incementing value to go. Is this possible?




Brent

Printing
 
Thank both of you for the help.

"Tom Ogilvy" wrote:

Sub AAAA()
Vio_Num = 3
For Coun = 1 To Vio_Num
Sheets(Coun).Activate
ActiveSheet.PageSetup.PrintArea = "$A$1:$L$45"
Next

End Sub


--
Regards,
Tom Ogilvy

"Brent" wrote in message
...
I am trying to complete a macro that is linked to a button to print

multiple
sheets from a workbook. The macro is intended to read a number from the
first sheet to determine how many sheets to print. This should be a short
program, but How would I write a for loop to access a different sheet each
time. This is what I have

For Coun = 1 To Vio_Num

Sheets("?").PageSetup.PrintArea = "$A$1:$L$45"


The ? is where I need the incementing value to go. Is this possible?





Brent

Printing
 
Is there a way to use the command

Worksheets("Sheet?").PageSetup.PrintArea......

Where ? increments. Or some function that would print consecutive sheets
through the for loop?

Jim Rech

Printing
 
Worksheets("Sheet" & Coun).PageSetup.PrintArea

--
Jim
"Brent" wrote in message
...
| Is there a way to use the command
|
| Worksheets("Sheet?").PageSetup.PrintArea......
|
| Where ? increments. Or some function that would print consecutive sheets
| through the for loop?




All times are GMT +1. The time now is 04:05 AM.

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