ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I use VBA to set the value of an ActiveX ComboBox (https://www.excelbanter.com/excel-programming/393329-how-can-i-use-vba-set-value-activex-combobox.html)

Harry F.

How can I use VBA to set the value of an ActiveX ComboBox
 
Hi, I have a form with several ActiveX Combo Boxes. I also have some check
boxes. When one checkbox value is true, I want the combobox to default to a
value, but when I put this code in, I get and "Object Not Defined" error
message.

Private Sub CheckBox6_Click()

If CheckBox6.Value = True Then

Worksheet.DropDown1176.Value = a89

End If

End Sub


Keep in mind I know Access VBA, but my Excel VBA skills are limited.

Thanks,
Harry

PCLIVE

How can I use VBA to set the value of an ActiveX ComboBox
 
Try this:

Private Sub CheckBox6_Click()

If CheckBox6.Value = True Then
Me.DropDown1176.Value = a89
End If

End Sub


HTH,
Paul

"Harry F." wrote in message
...
Hi, I have a form with several ActiveX Combo Boxes. I also have some
check
boxes. When one checkbox value is true, I want the combobox to default to
a
value, but when I put this code in, I get and "Object Not Defined" error
message.

Private Sub CheckBox6_Click()

If CheckBox6.Value = True Then

Worksheet.DropDown1176.Value = a89

End If

End Sub


Keep in mind I know Access VBA, but my Excel VBA skills are limited.

Thanks,
Harry




Harry F.

How can I use VBA to set the value of an ActiveX ComboBox
 
Now I get an error "Method or data member not found".

"PCLIVE" wrote:

Try this:

Private Sub CheckBox6_Click()

If CheckBox6.Value = True Then
Me.DropDown1176.Value = a89
End If

End Sub


HTH,
Paul

"Harry F." wrote in message
...
Hi, I have a form with several ActiveX Combo Boxes. I also have some
check
boxes. When one checkbox value is true, I want the combobox to default to
a
value, but when I put this code in, I get and "Object Not Defined" error
message.

Private Sub CheckBox6_Click()

If CheckBox6.Value = True Then

Worksheet.DropDown1176.Value = a89

End If

End Sub


Keep in mind I know Access VBA, but my Excel VBA skills are limited.

Thanks,
Harry





PCLIVE

How can I use VBA to set the value of an ActiveX ComboBox
 
How did you create your ComboBox "DropDown1176"?

"Harry F." wrote in message
...
Now I get an error "Method or data member not found".

"PCLIVE" wrote:

Try this:

Private Sub CheckBox6_Click()

If CheckBox6.Value = True Then
Me.DropDown1176.Value = a89
End If

End Sub


HTH,
Paul

"Harry F." wrote in message
...
Hi, I have a form with several ActiveX Combo Boxes. I also have some
check
boxes. When one checkbox value is true, I want the combobox to default
to
a
value, but when I put this code in, I get and "Object Not Defined"
error
message.

Private Sub CheckBox6_Click()

If CheckBox6.Value = True Then

Worksheet.DropDown1176.Value = a89

End If

End Sub


Keep in mind I know Access VBA, but my Excel VBA skills are limited.

Thanks,
Harry







Harry F.

How can I use VBA to set the value of an ActiveX ComboBox
 
It's an ActiveX control....I didn't actually create them, but they are not
from the Form Design menu. Would it be easier for me to recreate all of
these this way?

"PCLIVE" wrote:

How did you create your ComboBox "DropDown1176"?

"Harry F." wrote in message
...
Now I get an error "Method or data member not found".

"PCLIVE" wrote:

Try this:

Private Sub CheckBox6_Click()

If CheckBox6.Value = True Then
Me.DropDown1176.Value = a89
End If

End Sub


HTH,
Paul

"Harry F." wrote in message
...
Hi, I have a form with several ActiveX Combo Boxes. I also have some
check
boxes. When one checkbox value is true, I want the combobox to default
to
a
value, but when I put this code in, I get and "Object Not Defined"
error
message.

Private Sub CheckBox6_Click()

If CheckBox6.Value = True Then

Worksheet.DropDown1176.Value = a89

End If

End Sub


Keep in mind I know Access VBA, but my Excel VBA skills are limited.

Thanks,
Harry







PCLIVE

How can I use VBA to set the value of an ActiveX ComboBox
 
In my first response, that method would be creating the ComboBox from the
Control Toolbox toolbar. I think that may work better.



"Harry F." wrote in message
...
It's an ActiveX control....I didn't actually create them, but they are not
from the Form Design menu. Would it be easier for me to recreate all of
these this way?

"PCLIVE" wrote:

How did you create your ComboBox "DropDown1176"?

"Harry F." wrote in message
...
Now I get an error "Method or data member not found".

"PCLIVE" wrote:

Try this:

Private Sub CheckBox6_Click()

If CheckBox6.Value = True Then
Me.DropDown1176.Value = a89
End If

End Sub


HTH,
Paul

"Harry F." wrote in message
...
Hi, I have a form with several ActiveX Combo Boxes. I also have
some
check
boxes. When one checkbox value is true, I want the combobox to
default
to
a
value, but when I put this code in, I get and "Object Not Defined"
error
message.

Private Sub CheckBox6_Click()

If CheckBox6.Value = True Then

Worksheet.DropDown1176.Value = a89

End If

End Sub


Keep in mind I know Access VBA, but my Excel VBA skills are limited.

Thanks,
Harry









Harry F.

How can I use VBA to set the value of an ActiveX ComboBox
 
:-( I'll do that then. Thanks!

"PCLIVE" wrote:

In my first response, that method would be creating the ComboBox from the
Control Toolbox toolbar. I think that may work better.



"Harry F." wrote in message
...
It's an ActiveX control....I didn't actually create them, but they are not
from the Form Design menu. Would it be easier for me to recreate all of
these this way?

"PCLIVE" wrote:

How did you create your ComboBox "DropDown1176"?

"Harry F." wrote in message
...
Now I get an error "Method or data member not found".

"PCLIVE" wrote:

Try this:

Private Sub CheckBox6_Click()

If CheckBox6.Value = True Then
Me.DropDown1176.Value = a89
End If

End Sub


HTH,
Paul

"Harry F." wrote in message
...
Hi, I have a form with several ActiveX Combo Boxes. I also have
some
check
boxes. When one checkbox value is true, I want the combobox to
default
to
a
value, but when I put this code in, I get and "Object Not Defined"
error
message.

Private Sub CheckBox6_Click()

If CheckBox6.Value = True Then

Worksheet.DropDown1176.Value = a89

End If

End Sub


Keep in mind I know Access VBA, but my Excel VBA skills are limited.

Thanks,
Harry











All times are GMT +1. The time now is 01:42 AM.

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