View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
42N83W 42N83W is offline
external usenet poster
 
Posts: 19
Default Using Controls on a Worksheet


"lurker111" wrote in message
...
I have used the "Userforms" and did many great things with controls to get
data from a user.
Now I want to create a "form" by placing the controls directly on a
worksheet. The problem I am having is determing how to access the
controls.
I can't figure out the object to reference.

For instance I have a combobox named PMcombo
I have tried:
activeworksheet.PMcombo
activeworksheet.forms.PMcombo
activeworksheet.controls.PMcombo
...(add about 75 other combinations of various objects)
I've tried creating an object to use the controls.findcontrol (type:=
msocontrolcombobox)...and tried it with a variant.

I have searched the help files...and now I have ended up here unable to
figure out such an easy little thing which prevents me from doing anything
at
all.

I plan to use the workbook_open method to populate the combobox from a
list
of data on the worksheet. I considered using a "form combobox" but unlike
the control combobox, it seems you cannot type your own value into it.

Thanks


You may be aware of this, maybe not, but...when placing controls on a
worksheet, the code that handles these controls is placed in the code module
for that worksheet, not a generic code module. In design Mode, place a
control (combobox) on the worksheet, right click on it and choose View Code.
You'll see that you're taken to the code module for that worksheet if you
look over in your Project Explorer window.

I'm thinking that might have something to do with it.

-gk-