Hi All, I need help!!  I've written this code to unhide a certain
number of sheets based on the value of "Sheet 15" G37. All the sheet
names I want to unhide begin with "Performance - Alt" so I was trying
to use this...

It seems there's some problem with the code below (see asterisks near
the bottom). The error says "subscript out of range."

Can someone please help?!?! Thanks!!

April


-----------------------------------------

Sub UnHideAlts()

Dim wbBook As Workbook
Dim wsSheet As Worksheet
Dim PerfAlt As Range
Dim i As Long

Set wbBook = ThisWorkbook
Set wsAltNo = wbBook.Worksheets("Sheet 15")

With wsAltNo
Set PerfAlt = .Range("G37")
End With

If PerfAlt.Value = 0 Or IsEmpty(PerfAlt.Value) Then
MsgBox "You have developed no Alternatives", vbInformation
Exit Sub
End If

For i = 1 To PerfAlt.Value
**wbBook.Sheets("Performance - Alt" & i).Visible = True**
Next i

End Sub

--~--~---------~--~----~------------~-------~--~----~
-------------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
-------------------------------------------------------------------------------------
-~----------~----~----~----~------~----~------~--~---

Reply via email to