#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default 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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default 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?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default 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?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default 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?


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default 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?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 printing problem--printing 1 document on 2 pages Bons Excel Discussion (Misc queries) 0 December 24th 09 04:15 PM
Excel Printing --Borders are not printing on the same page as data Stup88 Excel Discussion (Misc queries) 1 August 7th 07 09:34 AM
Printing a heading on each new page when printing Brian Excel Discussion (Misc queries) 3 November 15th 06 05:22 PM
Enable Double sided printing contiuously when printing multiple s. Lee Excel Discussion (Misc queries) 1 November 27th 04 01:58 AM
Printing? Worksheets not printing the same on multiple pc's! 43fan Excel Programming 2 April 29th 04 02:34 PM


All times are GMT +1. The time now is 11:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"