View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Select sheets based on what is in a range.

Give this a try...

Sub SelectSheets()
Dim rng As Range
Dim rngTabs As Range

Set rngTabs = Range("A1", Cells(Rows.Count, "A").End(xlUp))
On Error Resume Next
For Each rng In rngTabs
Sheets(rng.Value).Select False
Next rng
On Error GoTo 0

End Sub
--
HTH...

Jim Thomlinson


"Steve" wrote:

Let say I have 5 tabs labeled AAA, BBB, CCC, DDD and EEE. In column A
starting in cell A1, I can have the name of 2, 3 or 4 tabs names listed
(number of tabs to select varies). Is there any way to program a macro to
look at the tab names listed in column A and select just those tabs?