Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
here is some code i use to set the print area
Range("A1").select ActiveWorkbook.Names.Add Name:="Top50Rpt", RefersTo:= _ Range(Range("A1"),Range("A1").Offset(49,15)) ActiveSheet.PageSetup.PrintArea = "Top50Rpt" You might have to change the code a little to something like: RefersTo:=Range(Range("A1"),Range("A1").end(xldown )_ ..end(xltoright) -----Original Message----- Hello I hope someone will help me to solve my problem. I have the data from column A to G (from H.. everything is blank) and I keep adding data below it. Is there any way I can run a macro to select the print area by finding the last row? Eg: if I have data in 16 rows and when I run the macro it should select the range A1- G16 and set the print area. Row 17 will have no data in it. Hope it is clear. Thanks in Advance Regds Toms --- Message posted from http://www.ExcelForum.com/ . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
cell selection code | Excel Discussion (Misc queries) | |||
Selection code | Excel Programming | |||
Code is dragging selection when should copy | Excel Programming | |||
Range selection code in a macro | Excel Programming | |||
Print Selection in Code | Excel Programming |