VBA combobox rowsource

K

kirke

HI all.
I write vba code for combo box.

formCombo.CmbDate.RowSource = "SELECT DISTINCT pp FROM SS ORDER BY
pp;"

but it doesn't work!
In here, pp is the column name and SS is sheet name. Is it wrong? I put
this code in "UserForm_Initialize"
And there's error on "formCombo.Show"
Thank you!
 
K

kirke

Sorry,
I'm confused with access.
I think i cannot use SQL in excel.
Then does anybody know how to filter the rowsource for combobox?

I mean, if column B have the data : 1 1 2 2 3 3 4 4
Then, If i put rowsource="Sheet1!B:B" then combobox shows 1 1 2 2 3 3 4
4.
I wanna put only 1 2 3 4.
Plz help me.

Thx.
 
B

Bob Phillips

see response in programming.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail 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