Need help with Excel Form & ComboBox Tutorial

T

tmb

At http://www.excel-vba.com/v-forms-controls.htm

I have followed instructions... my code on the form is below but it won't
run... I've marked the error...

Can anybody give me any help with this?

thanks

Code is below--------------

Private Sub cmdBtnSubmit_Click()
shReport.Range("C4").Value = cbxCity.Value
cbxCity.Value = "Select a City"
frmCity.Hide
End Sub

Private Sub cmdCityCancel_Click()

cbxCity.Value = "Select a City"
frmCity.Hide

End Sub

Private Sub UserForm_Activate()

shParameterst.Activate '<-----Run Time Error 424 - Object Required
cbxCity.ColumnCount = 1
cbxCity.RowSource = "A1:A5"

End Sub
 
L

liuhao

Hi,tmb

Perhaps the Worksheet named "shParameterst" has been deleted or rename
,please check it.
 
B

Bob Phillips

What they seem to be forgetting to tell you is that you need to rename the
codename of the worksheet with the data to shParameters. Note the codename,
not the name that you see in the sheet tab in Excel.

To do this, select the sheet in the VBE, hit F4, and a properties window
should be there, with the Name property highlighted. Change the value there.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top