Object required error setting combo box row source

tigersden

Board Regular
Joined
Oct 5, 2005
Messages
91
Hi All,

Can someone please point in the right direction with this object required error.
The line of code that produces it is:
cboPPoint1.RowSource = Worksheets("Sheet2").Range("I4").Value


Thanks in advance
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Where are you running this code?

What type of combobox are you using?

Have you checked it's name?
 
Upvote 0
Hi Norie,

The code is run from a module triggered from another combo boxes chage event, the combo box is on a worksheet & from the controls toolbar.
I have checked its name in the properties window & it is correct.

Really stumped by this
 
Upvote 0
Can you post all the code and indicate where it is located?

I'm thinking that the combobox is outwith the scope of the module.

Why don't you just put this code in the change event for the other combobox?

By the way like I said in the other thread RowSource is for comboboxes on userforms, you need ListFillRange for one from the Control Toolbox.
 
Upvote 0
Hi Norie,
The code is in module 3.
The complete code listing is shown below, I have stripped out a lot of the previous stuff as it was not needed. I have also altered the rowsource property to ListFillRange as you suggested.

Sub DropDown22_Change()
cboPPoint1.ListFillRange = Worksheets("Sheet2").Range("I4").Value
End Sub


Thanks in advance.
 
Upvote 0
Why do you have this in a standard module?

It should be in the worksheet module of the worksheet that DropDown22 and cboPPoint1 are on.

The easiest way to find where to put code for controls is to double click on the worksheet when you are in design mode.
 
Upvote 0
Hi Norie,
Thanks for taking the time to have a look.
I have moved the code onto the worksheet module. Everything is working fine now, there was one other problem I had not named the sheet for the range that the vlookup function returned, eg A1:A5 should have been Sheet2!A1:A5.
Many thanks for all your help
 
Upvote 0
Glad it's working.:)

You should only need the sheet name if the range is on a different sheet to the code.
 
Upvote 0
Hi Norie,

Thanks for all your help one lat thing is there anyway to clear the second comb box prior to filling it, so nothing is shown as selected?
 
Upvote 0
Try either setting it's ListIndex to -1 or it's Value to "".
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top