Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Select first 3 sheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Select first 3 sheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Select first 3 sheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Select first 3 sheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Select first 3 sheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Select first 3 sheets

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sheets.select kurt Excel Programming 2 November 28th 05 04:34 PM
select sheets snax500[_2_] Excel Programming 6 June 8th 05 04:48 AM
How to select other sheets using ADO farmer[_2_] Excel Programming 2 October 24th 04 06:56 PM
select a1 on all sheets Piers Clinton-Tarestad Excel Programming 1 October 1st 03 08:34 PM
select sheets by name - how? Walt[_2_] Excel Programming 5 July 30th 03 10:42 PM


All times are GMT +1. The time now is 06:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"