scotthannaford1973
Board Regular
- Joined
- Sep 27, 2017
- Messages
- 110
- Office Version
- 2010
- Platform
- Windows
Hi all and TIA
I have a workbook with a couple of buttons - one that unhides a couple of workheets called "Audit Trail" and "Audit Trail Open", and another that hides the two sheets. These work great and happy with both... but... I also have a large number of worksheets whose names all start with schemes - such as Schemes - 03 Jan 2020, Schemes - 20-Jan-2020 12¦03 etc (basically they are backup copies) and I want to hide them all in one go. So the question is: can the "Closes" code below be changed so that it hides all schemes whose name starts with: schemes -
thanks
CLOSES:
Sub Hide_Audit()
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("AUDIT TRAIL").Select
ActiveSheet.Visible = xlSheetVeryHidden
Sheets("AUDIT TRAIL OPEN").Select
ActiveSheet.Visible = xlSheetVeryHidden
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("ADMIN").Select
MsgBox "Audit Trail Worksheets Closed"
End Sub
OPENS:
Private Sub CommandButton1_Click()
If TextBox1 = "Password" Then
Sheets("AUDIT TRAIL").Visible = True
Sheets("AUDIT TRAIL OPEN").Visible = True
Me.StartUpPosition = 0
Me.Left = Application.Left + (0.5 * Application.Width) - (0.5 * Me.Width)
Me.Top = Application.Top + (0.5 * Application.Height) - (0.5 * Me.Height)
Else
MsgBox "wrong password"
End If
Unload Me
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub UserForm_Click()
End Sub
I have a workbook with a couple of buttons - one that unhides a couple of workheets called "Audit Trail" and "Audit Trail Open", and another that hides the two sheets. These work great and happy with both... but... I also have a large number of worksheets whose names all start with schemes - such as Schemes - 03 Jan 2020, Schemes - 20-Jan-2020 12¦03 etc (basically they are backup copies) and I want to hide them all in one go. So the question is: can the "Closes" code below be changed so that it hides all schemes whose name starts with: schemes -
thanks
CLOSES:
Sub Hide_Audit()
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("AUDIT TRAIL").Select
ActiveSheet.Visible = xlSheetVeryHidden
Sheets("AUDIT TRAIL OPEN").Select
ActiveSheet.Visible = xlSheetVeryHidden
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("ADMIN").Select
MsgBox "Audit Trail Worksheets Closed"
End Sub
OPENS:
Private Sub CommandButton1_Click()
If TextBox1 = "Password" Then
Sheets("AUDIT TRAIL").Visible = True
Sheets("AUDIT TRAIL OPEN").Visible = True
Me.StartUpPosition = 0
Me.Left = Application.Left + (0.5 * Application.Width) - (0.5 * Me.Width)
Me.Top = Application.Top + (0.5 * Application.Height) - (0.5 * Me.Height)
Else
MsgBox "wrong password"
End If
Unload Me
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub UserForm_Click()
End Sub