Hi all
I am trying to get a user to make a selection from a combo box on opening the spreadsheet.
So far I have:
(In Micrsoft Excel Projects - This Workbook)
Private Sub Workbook_Open()
Port = Range("D5"
.Value
If Port = "" Then
MsgBox "error"
Call frmPort_Open
End If
End Sub
(in Forms)
Private Sub frmPort_Intialize()
cboPort.AddItem "One"
cboPort.AddItem "Two"
cboPort.AddItem "Three"
cboPort.AddItem "Four"
End Sub
Public Sub frmPort_Open()
FrmPort.Show
End Sub
frmPort is the name of the form
cboPort is the name of the combobox
However, when this code runs, I get the error "Compile Error: Function of Sub not Defined" on the line Call frmPort_Open. And the form never appears. If I move the Public Sub frmPort_Open () to be in In Micrsoft Excel Projects - This Workbook, the form shows, but there are no values in my combo box.
What have I got wrong???
Cheers
Anna
I am trying to get a user to make a selection from a combo box on opening the spreadsheet.
So far I have:
(In Micrsoft Excel Projects - This Workbook)
Private Sub Workbook_Open()
Port = Range("D5"
If Port = "" Then
MsgBox "error"
Call frmPort_Open
End If
End Sub
(in Forms)
Private Sub frmPort_Intialize()
cboPort.AddItem "One"
cboPort.AddItem "Two"
cboPort.AddItem "Three"
cboPort.AddItem "Four"
End Sub
Public Sub frmPort_Open()
FrmPort.Show
End Sub
frmPort is the name of the form
cboPort is the name of the combobox
However, when this code runs, I get the error "Compile Error: Function of Sub not Defined" on the line Call frmPort_Open. And the form never appears. If I move the Public Sub frmPort_Open () to be in In Micrsoft Excel Projects - This Workbook, the form shows, but there are no values in my combo box.
What have I got wrong???
Cheers
Anna