Printing pages using a reference number in a cell

ryang77

New Member
Joined
Jul 18, 2007
Messages
5
I'm havening a problem figuring out how to only print a set amount of pages when i hit the print button, instead of going to file print and telling it how many pages to print. i have a template I'm using that is 9 pages long. i have a cell that is set up to count the number of pages in a report every time we start typing on the next page. ex( its says 1 of 1 until we type in the next page then says 1 of 2, the number in the cell keep getting bigger) is there anyway to have the print button just print how many pages i have typed into instead of all 9? thanks
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

ravishankar

Well-known Member
Joined
Feb 23, 2006
Messages
3,566
Hi
assuming your page nos is in A1
Paste the following codes in the macro window ( Alt F8)

Code:
 a = Right(Cells(1, 1), 1)
  ActiveWindow.SelectedSheets.PrintOut From:=1, To:=a, Copies:=1, Collate _
        :=True
run the macro. It will print from page 1 to last page typed.
Ravi
 
Upvote 0

Forum statistics

Threads
1,191,353
Messages
5,986,162
Members
440,007
Latest member
cjw29209

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top