PDA

View Full Version : GUI Excel



troelsi
03-19-2009, 07:30 AM
Hello

I'm using the new version of Excel and I have made some sort of interface that contains dropdown lists and check boxes. However, I don't know how to connect the interface with the VBA code.

I would like to store the choices selected with the drop-down box in a variabel, so I can use the information entered in my vba.code. Also i would like to store in a variabel if the checkboxes are cheked or not.

I suppose there is a rather simepl way of dealing with this that I just don't know of.

Please help.


Regards
Troels

Jan Karel Pieterse
03-19-2009, 07:39 AM
Which controls did you use, from the forms section or from the activex section?

The forms section controls you can rightclick and select assign macro
The others you simply doubleclick (set Excel in design mode on the developer tab first) the control and the editor opens with one fo the default events for that control.

troelsi
03-19-2009, 10:40 AM
Thanks for your reply.
I have used the forms section controls.

I know how to assign a macro to the form now.
But I still do not know what types of vba-commands to use. Do you know where I can find some examples of how to use a dropdown box and a checkbox.

Thanks in advance

Bob Phillips
03-19-2009, 10:43 AM
The simplest way is to bind the input range and the output value to the dropdown (via (Format Control>Control) and manipulate these from VBA>

mdmackillop
03-19-2009, 02:05 PM
http://www.contextures.com/xlUserForm02.html