Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]() If my data starts in cell B5 but the number of columns and/or rows can vary, how do I write a print macro to cover that if there are no gaps in the data i.e. one solid range of data? And how do I get around the problem of a blank line within the range? -- Brisbane Rob ------------------------------------------------------------------------ Brisbane Rob's Profile: http://www.excelforum.com/member.php...o&userid=25096 View this thread: http://www.excelforum.com/showthread...hreadid=401725 |
#2
![]() |
|||
|
|||
![]() I'd approach it this way - find the last row from bottom and last column from the right dim prange as range endrow = cells(65536,2).end(xlup).row 'assumes there is always something in column b endcol = cells(2,256).end(xltoleft).column ' assumes there is alway something in row 2 prange = range (cells(5,2) , cells(endrow,endcol)) -- duane ------------------------------------------------------------------------ duane's Profile: http://www.excelforum.com/member.php...o&userid=11624 View this thread: http://www.excelforum.com/showthread...hreadid=401725 |
#3
![]() |
|||
|
|||
![]() That seems to work fine. Many thanks - much appreciated. -- Brisbane Rob ------------------------------------------------------------------------ Brisbane Rob's Profile: http://www.excelforum.com/member.php...o&userid=25096 View this thread: http://www.excelforum.com/showthread...hreadid=401725 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HOW DO I PRINT USING A MACRO? | Excel Discussion (Misc queries) | |||
how do I print a range without printing the blank pages? | Excel Discussion (Misc queries) | |||
Printing - Have to set print area 1 column further than necessary | Excel Discussion (Misc queries) | |||
I WANT TO SET PRINT RANGE TO NUMBER OF COLUMNS | Setting up and Configuration of Excel | |||
Macro for changing print settings | Excel Discussion (Misc queries) |