VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} frmMenu
Caption = "MENU"
ClientHeight = 5250
ClientLeft = 45
ClientTop = 375
ClientWidth = 4860
OleObjectBlob = "frmMenu.frx"':0000
ShowModal = 0 'False
StartUpPosition = 1 'CenterOwner
End
Attribute VB_Name = "frmMenu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub chkHideOthers_Change()
If chkHideOthers.Value Then
chkShowAll.Value = False
End If
End Sub
Private Sub chkShowAll_Click()
If chkShowAll.Value Then
chkHideOthers.Value = False
End If
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdSelect_Click()
Application.ScreenUpdating = False
Dim i&, StrSheetName$
With lstSheets
If .ListIndex <> -1 Then
StrSheetName = .List(.ListIndex)
End If
End With
Unload Me
ActiveWorkbook.Sheets(StrSheetName).Visible = True
ActiveWorkbook.Sheets(StrSheetName).Select
Application.EnableEvents = False
With lstSheets
If chkHideOthers.Value Then
For i = 0 To lstSheets.ListCount - 1
If .List(i, 0) <> StrSheetName Then
ActiveWorkbook.Sheets(.List(i, 0)).Visible = False
End If
Next
ElseIf chkShowAll.Value Then
For i = 0 To lstSheets.ListCount - 1
ActiveWorkbook.Sheets(.List(i, 0)).Visible = True
Next
Else
For i = 0 To lstSheets.ListCount - 1
If .List(i, 0) = StrSheetName Then
ActiveWorkbook.Sheets(.List(i, 0)).Visible = True
End If
Next
End If
End With
Application.EnableEvents = True
End Sub
Private Sub lstSheets_Change()
Dim Cll As Range
With lstSheets
If .ListIndex <> -1 Then
For Each Cll In ActiveSheet.UsedRange.Cells
If Cll = .List(.ListIndex) Then
Application.EnableEvents = False
Cll.Select
Application.EnableEvents = True
End If
Next
End If
End With
End Sub
Private Sub UserForm_Activate()
Dim Ws As Worksheet, CurIndex&
With lstSheets
For Each Ws In ActiveWorkbook.Worksheets
.AddItem
.List(.ListCount - 1, 0) = Ws.Name
.List(.ListCount - 1, 1) = Ws.CodeName
If Ws.Name = ActiveSheet.Name Then
CurIndex = .ListCount - 1
End If
Next
If CurIndex <> -1 Then
.Selected(CurIndex) = True
End If
cmdSelect.Enabled = .ListIndex <> -1
End With
End Sub