Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi
Can someone list the full script i would need for a macro that would highlight all the non blank cells of a worksheet & set that as the print area. I have tried recording my own, basically; highlight Cell A1, Ctrl+Shift Down then Control+Shift Right, but the resulting script is still specific to the cell references of the sheet i used to record on. I do not know how to program it for just all active cells regardless of what they are, from sheet to sheet. Any help gratefully recieved. Cheers jb |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
JB,
This: Selection.CurrentRegion.Select Will select the current region providing that there are no entire rows or columns blank, i.e. it will select from the cell uppermost and to the left and bottommost and to the right before the next blank columns and rows. Regards Colin "JB2010" wrote in message ... Hi Can someone list the full script i would need for a macro that would highlight all the non blank cells of a worksheet & set that as the print area. I have tried recording my own, basically; highlight Cell A1, Ctrl+Shift Down then Control+Shift Right, but the resulting script is still specific to the cell references of the sheet i used to record on. I do not know how to program it for just all active cells regardless of what they are, from sheet to sheet. Any help gratefully recieved. Cheers jb |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I forgot to add:
Sheets ("xxx").Select Range("A1").Select (Assuming data starts here) Selection.CurrentRegion.Select Colin "JB2010" wrote in message ... Hi Can someone list the full script i would need for a macro that would highlight all the non blank cells of a worksheet & set that as the print area. I have tried recording my own, basically; highlight Cell A1, Ctrl+Shift Down then Control+Shift Right, but the resulting script is still specific to the cell references of the sheet i used to record on. I do not know how to program it for just all active cells regardless of what they are, from sheet to sheet. Any help gratefully recieved. Cheers jb |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Maybe:
With ActiveSheet .PageSetup.PrintArea = .Range("A1").CurrentRegion.Address end with JB2010 wrote: Hi Can someone list the full script i would need for a macro that would highlight all the non blank cells of a worksheet & set that as the print area. I have tried recording my own, basically; highlight Cell A1, Ctrl+Shift Down then Control+Shift Right, but the resulting script is still specific to the cell references of the sheet i used to record on. I do not know how to program it for just all active cells regardless of what they are, from sheet to sheet. Any help gratefully recieved. Cheers jb -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to include Close Print Preview | Charts and Charting in Excel | |||
Extra Row in Defined Print Area | Excel Discussion (Misc queries) | |||
Macro to open print window and set to print entire workbook | Excel Discussion (Misc queries) | |||
Printing - Have to set print area 1 column further than necessary | Excel Discussion (Misc queries) | |||
Changing print area | Excel Discussion (Misc queries) |