Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many Thanks ... It works
"Sam Wilson" wrote: This will work: Sub demo() Dim ws As Worksheet Set ws = ActiveSheet ws.PageSetup.PrintArea = ws.Range("a1").Resize(710, ws.Cells.SpecialCells(xlCellTypeLastCell).Column). Address End Sub "manfareed" wrote: I have finance spreadsheets i.e. P&Ls for different countries. Each of the spreadsheets has a different last column which has data in it. These reports are generated from our finance reporting tool. Instead of manually setting a print range, is there a way of using VBA to set the range which takes into account the last column with data. The last row in all cases should be €ś710€ť.[egs of print areas : .PrintArea = "$A$1:$BM$710" ; .PrintArea = "$A$1:$BA$710"] I dont know what the print range will be until the report has been ran. I wish to attach the €śmacro€ť to the blank template which is used by the reporting tool. When a country specific report is ran the relevant columns will be €śpopulated€ť. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
print range won't print | Excel Discussion (Misc queries) | |||
Print Range | Setting up and Configuration of Excel | |||
Print Blank Pgs - Preview margins outside print range | Excel Discussion (Misc queries) | |||
Can you get the range reference for each page in a worksheet print range? | Excel Programming | |||
Excel 2000 VBA - Set Print Range in dynamic range | Excel Programming |