Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a spreadsheet and I want the macro to set the print
area for me each time since the amount of data will be chaning on a regular basis. I have the following from using the macro recorder but it is not working. The macro recorder hardcoded the cell addresses based on the current data. I'm trying to change it to change the print area to the selected cells. Any suggestions would be appreciated. Here's the code I tried: Sub Print_Area() Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select Range(Selection, Selection.End(xlDown)).Select (The above lines properly select the data I want. The following line is where I have the problem. I just don't know the proper syntax.) ActiveSheet.PageSetup.PrintArea = Selection End Sub Thanks for the help. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
set area in excel not giving me option to set print area? | Excel Discussion (Misc queries) | |||
File, print area, clear area, is not working | New Users to Excel | |||
How do you turn off a print area for a page? (no print area) | Excel Discussion (Misc queries) | |||
changing print area in an entire workbook | Excel Worksheet Functions | |||
Changing print area | Excel Discussion (Misc queries) |