Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to select the first 3 sheets in my workbook, regardless of their
names. I've tried Sheets(Array(Sheets(1), Sheets(2), Sheets(3))).Select but I get "Type Mismatch" What am I doing wrong? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi StephanieH,
Try: Sheets(Array(1, 2, 3)).Select --- Regards, Norman "StephanieH" wrote in message ... I need to select the first 3 sheets in my workbook, regardless of their names. I've tried Sheets(Array(Sheets(1), Sheets(2), Sheets(3))).Select but I get "Type Mismatch" What am I doing wrong? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sheets(Array(1,2,3)).Select
-- Regards, Tom Ogilvy "StephanieH" wrote in message ... I need to select the first 3 sheets in my workbook, regardless of their names. I've tried Sheets(Array(Sheets(1), Sheets(2), Sheets(3))).Select but I get "Type Mismatch" What am I doing wrong? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Stephanie,
The mismatch is because it's looking for strings (sheet names): Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select hth, Doug "StephanieH" wrote in message ... I need to select the first 3 sheets in my workbook, regardless of their names. I've tried Sheets(Array(Sheets(1), Sheets(2), Sheets(3))).Select but I get "Type Mismatch" What am I doing wrong? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perfect. Thanks Norman and Tom.
Doug, I think you've specified "Sheet1" as the sheet name, which is what I'm avoiding. "StephanieH" wrote: I need to select the first 3 sheets in my workbook, regardless of their names. I've tried Sheets(Array(Sheets(1), Sheets(2), Sheets(3))).Select but I get "Type Mismatch" What am I doing wrong? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes, my mistake.
Doug "StephanieH" wrote in message ... Perfect. Thanks Norman and Tom. Doug, I think you've specified "Sheet1" as the sheet name, which is what I'm avoiding. "StephanieH" wrote: I need to select the first 3 sheets in my workbook, regardless of their names. I've tried Sheets(Array(Sheets(1), Sheets(2), Sheets(3))).Select but I get "Type Mismatch" What am I doing wrong? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sheets.select | Excel Programming | |||
select sheets | Excel Programming | |||
How to select other sheets using ADO | Excel Programming | |||
select a1 on all sheets | Excel Programming | |||
select sheets by name - how? | Excel Programming |