View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Steve Steve is offline
external usenet poster
 
Posts: 1,814
Default Selecting sheets based on cell in each sheet

Thank you very much, that worked perfectly.

"Excelenator" wrote:


This code will do what you ask


Code:
--------------------
Private Sub test()
Dim w As Worksheet
Dim ws() As String
Dim i As Integer

i = 0

For Each w In Worksheets
If UCase(w.Range("A1").Value) = "YES" Then
ReDim Preserve ws(i)
ws(i) = w.Name
i = i + 1
End If
Next w

Sheets(ws).Select

End Sub
--------------------


--
Excelenator


------------------------------------------------------------------------
Excelenator's Profile: http://www.excelforum.com/member.php...o&userid=36768
View this thread: http://www.excelforum.com/showthread...hreadid=568108