LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Can I include noncontiguous worksheet in array of worksheets?

The following code selects contiguous worksheets 5 through 11.

============

Sub SelectSheets()

Dim Sh() As Variant, wks As Worksheet, i As Integer

i = 0

For Each wks In ActiveWorkbook.Sheets
If wks.Range("E2") = 1 Then
i = i + 1
ReDim Preserve Sh(1 To i)
Sh(i) = wks.Name
End If
Next
Worksheets(Sh()).Select

End Sub

===============

I would like to add one noncontiguous worksheet (#32) to the array of
selected worksheets. Is there a way to do so?


Barney Byrd


 
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
How do I write an array to include all worksheets in a workbook? Jodie Excel Worksheet Functions 8 October 13th 09 04:06 PM
how do I include multiple worksheets to a countif formula? Brigette Excel Discussion (Misc queries) 1 August 19th 09 10:58 PM
include criteria to 'rank based array function' TUNGANA KURMA RAJU Excel Discussion (Misc queries) 2 September 2nd 06 01:15 PM
How to Include exl charts from closed worksheets into PPT slides akshetrapal Excel Programming 3 January 24th 04 06:13 PM
Is it possible to include Excel worksheets/workbooks into COM Addins ? alkan Excel Programming 1 November 14th 03 02:04 PM


All times are GMT +1. The time now is 03:45 AM.

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"