ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   activex controls (https://www.excelbanter.com/excel-programming/329413-activex-controls.html)

Gary

activex controls
 
Quite an indepth sheet to sort data using various activex controls such as
combo box, option / tick box. Problem is when I run a macro and include the
function of a combo box, the macro does not recognise the box ? Call me
stupid but it is the control box type, must these contols have their own
macros assigned inoeder to work ? I have used these as a basis to the sheet
linking 1000's of calcs.
PS very urgent as sheet required Mon 16th May.
Thanks

Peter T

activex controls
 
Call me stupid but it is the control box type, must these contols have
their own
macros assigned inoeder to work ?


Morning Stupid, as you ask t.b. referred as :-)

Not exactly. Unlike controls from the Forms menu to which you do assign a
macro, those from the Controls Toolbox menu respond to "Events". From this
menu activate "Design Mode", select your control. right click, view code.

This should take you into the Sheet module with the Click event ready for
you to enter your code. Here you can either do your stuff or call a
procedure in a normal module, eg:

Private Sub CommandButton1_Click()
Dim var As Variant
Dim result As Variant
var = Range("A1").Value

result = MyFunc(var) ' MyFunc in a normal module

Range("B1").Value = result
End Sub

You will notice two dropdowns at the top of the module. From the left select
the name of the control and in the right you can select other Events in
which you can write your code. Typically you will only need the "Click"
event.

Regards,
Peter T



"Gary" wrote in message
...
Quite an indepth sheet to sort data using various activex controls such as
combo box, option / tick box. Problem is when I run a macro and include

the
function of a combo box, the macro does not recognise the box ? Call me
stupid but it is the control box type, must these contols have their own
macros assigned inoeder to work ? I have used these as a basis to the

sheet
linking 1000's of calcs.
PS very urgent as sheet required Mon 16th May.
Thanks




Bob Phillips[_7_]

activex controls
 
Gary,

You are not clear as to what you are doing and what the controls are for.
For instance, what does '... and include the function of a combo box ...'
mean?

--
HTH

Bob Phillips

"Gary" wrote in message
...
Quite an indepth sheet to sort data using various activex controls such as
combo box, option / tick box. Problem is when I run a macro and include

the
function of a combo box, the macro does not recognise the box ? Call me
stupid but it is the control box type, must these contols have their own
macros assigned inoeder to work ? I have used these as a basis to the

sheet
linking 1000's of calcs.
PS very urgent as sheet required Mon 16th May.
Thanks





All times are GMT +1. The time now is 04:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com