Skip to content

Instantly share code, notes, and snippets.

@workmad3
Last active August 21, 2018 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save workmad3/0aa52f6231a16eb61b99d1531f989d17 to your computer and use it in GitHub Desktop.
Save workmad3/0aa52f6231a16eb61b99d1531f989d17 to your computer and use it in GitHub Desktop.
Customer Profile Selector
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Dim wsSheet As Worksheet
Application.ScreenUpdating = False
Select Case Range("H5")
Case "Hain"
For Each wsSheet In Worksheets
wsSheet.Visible = xlSheetHide
If wsSheet.Name Like "*Hain*" Or wsSheet.Name = "Customer Contacts" Or wsSheet.Name = "Retail Overview" Or wsSheet.Name = "Strategies & Decision Criteria" Or wsSheet.Name = "Leadtimes" Or wsSheet.Name = "Scorecard" Or wsSheet.Name = "Select Client Profile" Then
wsSheet.Visible = True
End If
Next wsSheet
Case "Tyson Pet"
For Each wsSheet In Worksheets
wsSheet.Visible = xlSheetHide
If wsSheet.Name Like "*Tyson*" Or wsSheet.Name = "Customer Contacts" Or wsSheet.Name = "Retail Overview" Or wsSheet.Name = "Strategies & Decision Criteria" Or wsSheet.Name = "Leadtimes" Or wsSheet.Name = "Scorecard" Or wsSheet.Name = "Select Client Profile" Then
wsSheet.Visible = True
End If
Next wsSheet
Case "US Nonwovens"
For Each wsSheet In Worksheets
wsSheet.Visible = xlSheetHide
If wsSheet.Name Like "*USN*" Or wsSheet.Name = "Customer Contacts" Or wsSheet.Name = "Retail Overview" Or wsSheet.Name = "Strategies & Decision Criteria" Or wsSheet.Name = "Leadtimes" Or wsSheet.Name = "Scorecard" Or wsSheet.Name = "Select Client Profile" Then
wsSheet.Visible = True
End If
Next wsSheet
Case "Bissell"
For Each wsSheet In Worksheets
wsSheet.Visible = xlSheetHide
If wsSheet.Name Like "*Bissell*" Or wsSheet.Name = "Customer Contacts" Or wsSheet.Name = "Retail Overview" Or wsSheet.Name = "Strategies & Decision Criteria" Or wsSheet.Name = "Leadtimes" Or wsSheet.Name = "Scorecard" Or wsSheet.Name = "Select Client Profile" Then
wsSheet.Visible = True
End If
Next wsSheet
End Select
Application.ScreenUpdating = True
Worksheets("Customer Contacts").Activate
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment