Thread: select sheets
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default select sheets

I'd do something like:

Option Explicit
Sub testme()
Dim iCtr As Long
Dim myLimit As Long

myLimit = 2
If Sheets.Count myLimit Then
For iCtr = myLimit To Sheets.Count
Sheets(iCtr).Select Replace:=CBool(iCtr = (myLimit + 1))
Next iCtr
End If
End Sub



snax500 wrote:

I have the following code:

Sheets(Array("Bridal", "Executive", "Facilities", "Finance",
"Furniture", "Housewares", _
"Human Resources", "Human Resources", "MIO", "Planning", "Real
Estate", "Retail Technology", _
"Stores Merch", "Tabletop", "Textiles", "Visual")).Select

How can I simplify this so that I select the third sheet in the file to
the last sheet in the file?

THanks


--

Dave Peterson