Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting sheets based on cell in each sheet
If I have a "Yes" or "No" in say cell A1 of each sheet in a workbook. Is
there a way to select each sheet that has a "Yes" in cell A1? There could be up to 100 sheets in the workbook. Thanks for any help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting sheets based on cell in each sheet
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting a cell entry based on cell validation selection | Excel Worksheet Functions | |||
selecting a single sheet from a volume of sheets in a workbook | Excel Worksheet Functions | |||
Selecting all sheets and sheet methods | Excel Programming | |||
Selecting Sheets based on Cell Criteria. | Excel Programming | |||
Selecting a sheet based on a cell | Excel Programming |