View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Select sheets based on what is in a range.

Hi Steve

You can make a array of the the cell values
There is no error check in this example

Sub aa()
Dim arr() As String
Dim N As Integer

N = 0
For Each cell In Columns("A").SpecialCells(xlCellTypeConstants)
N = N + 1
ReDim Preserve arr(1 To N)
arr(N) = cell.Value
Next

ActiveWorkbook.Worksheets(arr).Select

End Sub

--
Regards Ron De Bruin
http://www.rondebruin.nl



"Steve" wrote in message ...
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?