sassriverrat
Well-known Member
- Joined
- Oct 4, 2018
- Messages
- 655
Hello All-
Everyone has been fantastic helping me build (and learn) VBA on this new workbook. It's been great- now I've run into an issue that i don't readily see.
I have 5 userforms. Userforms 1, 2, and 3 open (Workbook_Open) based on one of three names of the workbook- Irregardless of which userform is used, they all have a button to choose "Developer" which opens Userform 5. Userform 5 has two buttons, one will ask for a password to show sheet1, the other just shows sheet2 (no password).
Coding for userform 5 is shown below. It seems when i open excel, the green mini excel window opens, loads, then opens the main window (workbook) for half a second before going to userform1(based on name- does this for any of the first 3 userforms). Once I click the appropriate button, the next userform will open (code below) and after selecting EITHER of its buttons, the workbook flashes behind again for a second and then excel is gone. Any ideas why excel is gone? Any way I can also stop the main workbook window from opening for that brief second before the first userform opens.
Everyone has been fantastic helping me build (and learn) VBA on this new workbook. It's been great- now I've run into an issue that i don't readily see.
I have 5 userforms. Userforms 1, 2, and 3 open (Workbook_Open) based on one of three names of the workbook- Irregardless of which userform is used, they all have a button to choose "Developer" which opens Userform 5. Userform 5 has two buttons, one will ask for a password to show sheet1, the other just shows sheet2 (no password).
Coding for userform 5 is shown below. It seems when i open excel, the green mini excel window opens, loads, then opens the main window (workbook) for half a second before going to userform1(based on name- does this for any of the first 3 userforms). Once I click the appropriate button, the next userform will open (code below) and after selecting EITHER of its buttons, the workbook flashes behind again for a second and then excel is gone. Any ideas why excel is gone? Any way I can also stop the main workbook window from opening for that brief second before the first userform opens.
Code:
Private Sub CommandButton1_Click()
ThisWorkbook.Sheets("Ports").Activate
Sheets("Notes").Visible = True
Application.Visible = True
Unload Me
End Sub
Private Sub CommandButton2_Click()
mypass = Application.InputBox("Enter Password", "The Coding Sheets")
If mypass = "1234567890" Then
Sheets("Developer").Visible = True
Sheets("Notes").Visible = True
Application.Visible = True
Unload Me
End Sub