G
gfalc3194
I'm somewhat new at message boards so forgive me if adding a new post
is not the way this should be done.
My original post is below. What I fail to mention is that there are
more than just 3 sheets in the workbook. It is more like this: sheet1,
sheet2,....up to sheet6. I want to first select and print sheets1
through 3, then select and print sheets 4 through 6 (To start the page
numbering over). I can't just select sheets by number, say
array(1,2,3), because if I add say sheet1b, I will then have four
sheets to print and would have to modify the macro.
thanks again. below is original post.
If I select the first sheet in a workbook, hold shift and go to the
last sheet, all are selected for printing. However, when I record this
function, the VBA code lists all sheets by name.
For instance, If the workbook contains 'sheet1' 'sheet2' and 'sheet3'
the macro code recorded = Sheets(Array("sheet1", "sheet2",
"sheet3")).Select
I would like to know if there is a way to select from sheet1 to sheet3
without explicitly naming them. The problem is that in the actual
workbook, sometimes I add or delete sheets, and sometimes rename them
for clarity. I don't want to have to modify the macro everytime I do
that. (the first and last sheets can always remain the same).
_________________
Thank you in advance for any help.
is not the way this should be done.
My original post is below. What I fail to mention is that there are
more than just 3 sheets in the workbook. It is more like this: sheet1,
sheet2,....up to sheet6. I want to first select and print sheets1
through 3, then select and print sheets 4 through 6 (To start the page
numbering over). I can't just select sheets by number, say
array(1,2,3), because if I add say sheet1b, I will then have four
sheets to print and would have to modify the macro.
thanks again. below is original post.
If I select the first sheet in a workbook, hold shift and go to the
last sheet, all are selected for printing. However, when I record this
function, the VBA code lists all sheets by name.
For instance, If the workbook contains 'sheet1' 'sheet2' and 'sheet3'
the macro code recorded = Sheets(Array("sheet1", "sheet2",
"sheet3")).Select
I would like to know if there is a way to select from sheet1 to sheet3
without explicitly naming them. The problem is that in the actual
workbook, sometimes I add or delete sheets, and sometimes rename them
for clarity. I don't want to have to modify the macro everytime I do
that. (the first and last sheets can always remain the same).
_________________
Thank you in advance for any help.