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,337
Default Help! Macro to select all sheet from AA to ZZ

Try this

Sub GroupSheets()

Dim sh As Object
Dim shArr() As String
Dim FirstSheet As Object
Dim LastSheet As Object

Set FirstSheet = Sheets("Sheet2")
Set LastSheet = Sheets("Sheet3")

ReDim shArr(FirstSheet.Index To LastSheet.Index)

For Each sh In ThisWorkbook.Sheets
If sh.Index = FirstSheet.Index And sh.Index <= LastSheet.Index Then
shArr(sh.Index) = sh.Name
End If
Next sh

Sheets(shArr).Select

End Sub

--
Post byDick Kusleika


--
Don Guillett
SalesAid Software

"Elaine Roden" wrote in message
...
How do I write a macro in Excel 2000 that selects all the sheets from

sheet aa to sheet zz. To explain what I need to do, our business is very
seasonal (about 40 year-round and 40 employees that come and go in spring
and fall) and when our employees are laid off, we move their sheets out of
the current section (aa-zz) and only print and update the emplyees that are
currently working. I would like to be able to move sheets in and out of this
group, but have the macro automatically select whatever sheets I have placed
between aa & zz. I am sort of new to Excel. I used to do all my programming
in a different spreadsheet, but the latest versions of it are terribly
unstable and I am converting everything to excel which is much more stable,
but it is a learning curve. (PS. aa and zz are names I gave to the dividing
sheets)

Thanks so much in advance. Your newsgroup is great and I have been able to

find lots of the answers that I need in here already!

Elaine



 
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
Select dynamic data in 2 columns, and repeat macro to next sheet Tasha Excel Discussion (Misc queries) 2 September 17th 09 07:00 PM
Macro to go to select sheet Kevin Excel Discussion (Misc queries) 2 December 18th 07 02:28 AM
macro sheet select Dave K Excel Discussion (Misc queries) 2 October 21st 05 10:08 PM
Macro, select Sheet "Number", NOT Sheet Name DAA Excel Worksheet Functions 4 November 30th 04 05:29 PM
On Sheet select Macro Colin G Eastwood Excel Programming 3 January 21st 04 05:22 PM


All times are GMT +1. The time now is 11: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"