sassriverrat
Well-known Member
- Joined
- Oct 4, 2018
- Messages
- 655
Good Morning,
I have three userforms that are failing-
Userform1 opens and you should click the button- which should take you to Userform4, which has a button that should take you to Userform2. If the document has a different name (as specified in the coding below), only Userform2 Opens (this works) and based on if Userform1 opened or not (again- name based), cmdbutton1 has two different macros it could run.
so here is the problem- Userform1 is giving me an error 13 when i click the CMDButton1 - It highlights "Userform4.Show"
2nd Problem- I can't get the captions for CMDButtons 3 and 4 in Userform 4 to input- the buttons stay blank. See Code below
thanks
I have three userforms that are failing-
Userform1 opens and you should click the button- which should take you to Userform4, which has a button that should take you to Userform2. If the document has a different name (as specified in the coding below), only Userform2 Opens (this works) and based on if Userform1 opened or not (again- name based), cmdbutton1 has two different macros it could run.
Code:
Private Sub Workbook_Open()
Application.Visible = False
If ActiveWorkbook.name = "Master Voyage Report.xlsm" Then
Userform4.Show
ElseIf ActiveWorkbook.name = "Current Voyage Report.xlsm" Then
Userform2.Show
Application.Visible = True
Else: Userform3.Show
Application.Visible = True
End If
End Sub
so here is the problem- Userform1 is giving me an error 13 when i click the CMDButton1 - It highlights "Userform4.Show"
Code:
Private Sub CommandButton1_Click()
Application.Visible = False
Userform4.Show
Unload me
End Sub
2nd Problem- I can't get the captions for CMDButtons 3 and 4 in Userform 4 to input- the buttons stay blank. See Code below
Code:
Private Sub Userform_Initialize()
Me.CommandButton3.Caption = ThisWorkBook.Sheets("Notes").Range("K18")
Me.CommandButton4.Caption = ThisWorkBook.Sheets("Notes").Range("L18")
End Sub
thanks