Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Need a little help please guys, I have a worksheet that, after running
filters, presents me with the data I actually need. Trouble is the list varies in length on each run. It's a pain to keep manually changing the print area. Can anyone help with a routine to set the print area down to the last "occupied" row? Any help greatly appreciated. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 25 Nov., 11:46, "mepetey" wrote:
Need a little help please guys, I have a worksheet that, after running filters, presents me with the data I actually need. Trouble is the list varies in length on each run. It's a pain to keep manually changing the print area. Can anyone help with a routine to set the print area down to the last "occupied" row? Any help greatly appreciated. Put the code in the codesheet for ThisWorkbook. Private Sub Workbook_BeforePrint(Cancel As Boolean) FirstCell = "A1" LastCell = Range("A1").End(xlDown).End(xlToRight).Address ActiveSheet.PageSetup.PrintArea = Range(FirstCell, LastCell).Address End Sub Regards, Per |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the fast response, how do I limit the print from column A to
column I? "Per Jessen" wrote in message ... On 25 Nov., 11:46, "mepetey" wrote: Need a little help please guys, I have a worksheet that, after running filters, presents me with the data I actually need. Trouble is the list varies in length on each run. It's a pain to keep manually changing the print area. Can anyone help with a routine to set the print area down to the last "occupied" row? Any help greatly appreciated. Put the code in the codesheet for ThisWorkbook. Private Sub Workbook_BeforePrint(Cancel As Boolean) FirstCell = "A1" LastCell = Range("A1").End(xlDown).End(xlToRight).Address ActiveSheet.PageSetup.PrintArea = Range(FirstCell, LastCell).Address End Sub Regards, Per |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cracked it. Thanks !
"mepetey" wrote in message ... Thanks for the fast response, how do I limit the print from column A to column I? "Per Jessen" wrote in message ... On 25 Nov., 11:46, "mepetey" wrote: Need a little help please guys, I have a worksheet that, after running filters, presents me with the data I actually need. Trouble is the list varies in length on each run. It's a pain to keep manually changing the print area. Can anyone help with a routine to set the print area down to the last "occupied" row? Any help greatly appreciated. Put the code in the codesheet for ThisWorkbook. Private Sub Workbook_BeforePrint(Cancel As Boolean) FirstCell = "A1" LastCell = Range("A1").End(xlDown).End(xlToRight).Address ActiveSheet.PageSetup.PrintArea = Range(FirstCell, LastCell).Address End Sub Regards, Per |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range(Range("A1"), ActiveCell.SpecialCells(xlLastCell)).Select
ActiveSheet.PageSetup.PrintArea = Selection.Address "mepetey" skrev: Need a little help please guys, I have a worksheet that, after running filters, presents me with the data I actually need. Trouble is the list varies in length on each run. It's a pain to keep manually changing the print area. Can anyone help with a routine to set the print area down to the last "occupied" row? Any help greatly appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Room Occupied Checker Formula Help | Excel Worksheet Functions | |||
newbie - how to paste into an occupied cell | New Users to Excel | |||
Find next occupied row up in another column | Excel Worksheet Functions | |||
Selecting occupied cell over empty ones | Excel Discussion (Misc queries) | |||
Selecting occupied cell over empty ones | Excel Discussion (Misc queries) |