LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Junior Member
 
Posts: 1
Default A simple printing pages depending on cell value

I hope someone can help because this is driving me absolutely bonkers. This should be something so easy yet....

I am trying to print a number of pages depending on a cell value which is a value of a formulae.

Code:
Sub PRINT_GENERIC()

Sheets("GENERIC").Select
a = Range("Z1").Value
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=a, Copies:=1
Sheets("MAINSHEET").Select

End Sub
The whole worksheet has page breaks in it to make 40 pages. Every time the above macro is run it will print 40 pages regardless of the value of (a).

What am I doing wrong?

Thanks
 
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
how to skip printing pages in exel by cell value Barry Excel Programming 2 August 6th 08 05:11 PM
Printing x amount of pages if cell is greater than 0 privater Excel Programming 0 February 2nd 08 10:01 AM
How do I delete pages in Excel? Keeps printing blank pages at end. Jojobean Charts and Charting in Excel 1 May 31st 07 07:37 AM
Printing Multiple Pages Based on Different Cell Criteria Nic W Excel Programming 1 September 20th 05 05:34 PM


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

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

About Us

"It's about Microsoft Excel"