Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a workbook with four pages, each with the same number of columns, but
various numbers of rows. I have a macro to automatically set the print area for those pages and it works just fine. Now I have to add a column to just one of the pages in the workbook. The macro I have naturally excludes the new last column. I suspect more changes are on the horizon i.e some pages growing, others shrinking. I'd rather have Excel 'see' what columns are present, rather than continually altering the code when I make changes. I tried to use XLRight instead of naming the column "U", but that doesn't work. I think I'm on the right track but probably not using the correct syntax. Here is the code. Any one have any ideas? Dim sh As Worksheet For Each sh In ActiveWorkbook.Worksheets sh.Activate Dim LastRow As Long With ActiveSheet LastRow = .Cells(.Rows.Count, "D").End(xlUp).Row .PageSetup.PrintArea = "A1:U" & LastRow End With Next |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Remove print area from multiples pages | Excel Discussion (Misc queries) | |||
Print Area ranges print on separate pages? | Excel Discussion (Misc queries) | |||
Set print area on several pages at once in Excell Workbook? | Excel Discussion (Misc queries) | |||
Print area will only go up to 101 pages | Excel Discussion (Misc queries) | |||
print pages when text area changes in size | Excel Programming |