Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Morning,
In col R of sheets 4 to 11, (named a b c etc), I have a list of numbers which ascend from 1. I would like to use these numbers to set a print range. The print range should be A1:O(last line of interest) The last line of interest is last line with a number greater than zero. So for example in -: Sheet 4 the number list starts in row 1 and reads 1 1 1 1 1 2 3 4 5 6 0 0 0 0 so the print range should be A1:O10. Sheet 5 it reads 23 23 23 23 23 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 0 0 0 0 so the print range should be A1:O23. Is it possible to have a macro that sets the print range for each sheet and then prints the sheets accordingly, with the printer selected from the usual pop-up dialogue box. Thanks LiAD |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try recording a macro when you set the print area to what you want.
Then you'll need to tweak it a bit. YOu can get the last row in column O this way Dim lRow as long Dim aWS as excel.worksheet set aWS = activesheet lrow = aws.range("O"&aws.rows.count).end(xlup).row -- HTH, Barb Reinhardt "LiAD" wrote: Morning, In col R of sheets 4 to 11, (named a b c etc), I have a list of numbers which ascend from 1. I would like to use these numbers to set a print range. The print range should be A1:O(last line of interest) The last line of interest is last line with a number greater than zero. So for example in -: Sheet 4 the number list starts in row 1 and reads 1 1 1 1 1 2 3 4 5 6 0 0 0 0 so the print range should be A1:O10. Sheet 5 it reads 23 23 23 23 23 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 0 0 0 0 so the print range should be A1:O23. Is it possible to have a macro that sets the print range for each sheet and then prints the sheets accordingly, with the printer selected from the usual pop-up dialogue box. Thanks LiAD |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry i forgot to say that the number list is in col R - therefore outside
the print area. I'm not sure how to create something to this. Thanks "Barb Reinhardt" wrote: Try recording a macro when you set the print area to what you want. Then you'll need to tweak it a bit. YOu can get the last row in column O this way Dim lRow as long Dim aWS as excel.worksheet set aWS = activesheet lrow = aws.range("O"&aws.rows.count).end(xlup).row -- HTH, Barb Reinhardt "LiAD" wrote: Morning, In col R of sheets 4 to 11, (named a b c etc), I have a list of numbers which ascend from 1. I would like to use these numbers to set a print range. The print range should be A1:O(last line of interest) The last line of interest is last line with a number greater than zero. So for example in -: Sheet 4 the number list starts in row 1 and reads 1 1 1 1 1 2 3 4 5 6 0 0 0 0 so the print range should be A1:O10. Sheet 5 it reads 23 23 23 23 23 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 0 0 0 0 so the print range should be A1:O23. Is it possible to have a macro that sets the print range for each sheet and then prints the sheets accordingly, with the printer selected from the usual pop-up dialogue box. Thanks LiAD |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
write a macro to print to search a list and print certain workshee | Excel Programming | |||
Macro to hide rows with a certain cell empty then set print area and print | Excel Programming | |||
Pivot Table macro to set print area and print details of drill down data | Excel Discussion (Misc queries) | |||
Macro to open print window and set to print entire workbook | Excel Discussion (Misc queries) | |||
Need Help w/ Print Macro to Print All Visible Sheets (including Charts) in a Workbook | Excel Programming |