Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have limited knowlege in VBA and would like help modifying the cod below. I have placed this in the workbook area of the VB editor....however I need this to really only apply to one page of th workbook. As is it is interferring with the other pages. Basically o the sheet "Hourly Update" I need it to print rows 1-(variable) based o column c (only print as far down as there are entries in column c). But for the other pages I would like it to print with the individua print areas already assigned to that page. Here is the code that I currently have: Private Sub Workbook_BeforePrint(Cancel As Boolean) ActiveSheet.PageSetup.PrintArea = Range("A1:Ak" & _ Range("c" & Rows.Count).End(xlUp).Row).Resize.Address End Sub I'm sure it is a lot easier than I am trying to make it, but I've trie everything that I know how. Thanks in advance, Jenn -- shikamikamoomo ----------------------------------------------------------------------- shikamikamoomoo's Profile: http://www.excelforum.com/member.php...fo&userid=2101 View this thread: http://www.excelforum.com/showthread.php?threadid=51600 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Workbook_BeforePrint(Cancel As Boolean)
if Activesheet.Name = "Hourly Update" then ActiveSheet.PageSetup.PrintArea = Range("A1:Ak" & _ Range("c" & Rows.Count).End(xlUp).Row).Resize.Address End If End Sub -- Regards, Tom Ogilvy "shikamikamoomoo" <shikamikamoomoo.23pega_1140734102.676@excelforu m-nospam.com wrote in message news:shikamikamoomoo.23pega_1140734102.676@excelfo rum-nospam.com... I have limited knowlege in VBA and would like help modifying the code below. I have placed this in the workbook area of the VBA editor....however I need this to really only apply to one page of the workbook. As is it is interferring with the other pages. Basically on the sheet "Hourly Update" I need it to print rows 1-(variable) based on column c (only print as far down as there are entries in column c). But for the other pages I would like it to print with the individual print areas already assigned to that page. Here is the code that I currently have: Private Sub Workbook_BeforePrint(Cancel As Boolean) ActiveSheet.PageSetup.PrintArea = Range("A1:Ak" & _ Range("c" & Rows.Count).End(xlUp).Row).Resize.Address End Sub I'm sure it is a lot easier than I am trying to make it, but I've tried everything that I know how. Thanks in advance, Jenny -- shikamikamoomoo ------------------------------------------------------------------------ shikamikamoomoo's Profile: http://www.excelforum.com/member.php...o&userid=21018 View this thread: http://www.excelforum.com/showthread...hreadid=516008 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I knew it was that simple!! So close, yet so far. :D Thanks for the help. -- shikamikamoomoo ------------------------------------------------------------------------ shikamikamoomoo's Profile: http://www.excelforum.com/member.php...o&userid=21018 View this thread: http://www.excelforum.com/showthread...hreadid=516008 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
split print area in excel - One Page Print | Excel Worksheet Functions | |||
Setting the print area in page set up to print 1 page wide by 2 pages tall | Excel Discussion (Misc queries) | |||
Print Area. 1st page Landscape 2nd page Portrait?? | Excel Worksheet Functions | |||
Active cell counting in particular print page (one sheet having different print area) | Excel Worksheet Functions | |||
How do you turn off a print area for a page? (no print area) | Excel Discussion (Misc queries) |