Skipvought: Thanks for the code. I have put it into the editor but I get an error message "Run-time error '1004': The text you entered is not a valid reference or defined name. The debugger highlights the line
.PageSetup.PrintArea = .Range("A1").CurrentRegion
Thoughts appreciated...
kjv1611: I tried pasting the code you wrote and running it.
I get an error message at ws.Selection saying "Compile error: Method or data member not found".
Suggestions would be appreciated.
Chris
Thanks for the responses! Loomah: I tried to figure out the code and the FAQ but cannot get it to work because I think they are too advanced. Embarassing but true. kjv1611: I have tried to integrate the code you wrote into my macro but cannot get it to start using <Ctrl> <Shift> H. Here it...
This is one of the macros I tried: I know this should be as basic as it gets but I am a basic user so I do not know how to write VBA. Again, I would like the range to be either A1: to the last cell with data or just the area that I have highlighted.
Sub Set_print_area()
'
' Set_print_area...
Hi! I get a number of Excel spreadsheets on a daily basis that are poorly formatted for printing. I want to create a macro to set the print area to print them.
All Sheets start in cell A1.
Ideally it would be a macro that would set the print area to a range A1:last cell with data in it...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.