ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   I have many cbox value to chg would like to use integer to do (https://www.excelbanter.com/excel-programming/355927-i-have-many-cbox-value-chg-would-like-use-integer-do.html)

whylite

I have many cbox value to chg would like to use integer to do
 
I have many combobox's and would like to change there values. Rather than
listing everysingle one in vba I would like to use a interger and have it
cycle through all of the combobox's and update them with a list. Any idea's
how I can write the code.

--
Thanks!
Shane W

Nigel

I have many cbox value to chg would like to use integer to do
 
Use the Controls function on the form, the following illustrates identifying
each control called ComboBox1 to ComboBox3

Dim xControl As Integer
For xControl = 1 To 3
Controls("ComboBox" & xControl).Enabled = False
Next


--
Cheers
Nigel



"whylite" wrote in message
...
I have many combobox's and would like to change there values. Rather than
listing everysingle one in vba I would like to use a interger and have it
cycle through all of the combobox's and update them with a list. Any

idea's
how I can write the code.

--
Thanks!
Shane W




whylite

I have many cbox value to chg would like to use integer to do
 
Thanks Nigel but I get a Message stating sub or function undefined for
Controls. Do I have to define Controls and/or is this a macro for a
userform. If I have to define Controls could you let me know how. The
combobox's that I am using are on a sheet. Sometimes I have to import values
from another workbook. The problem I am having is when the values come into
the sheet and hit the combobox's the macro attached to the boxes goes off
shutting excel down because of overload. That is why I need to hit the
combobox's with the values instead. If I input the value into the box
everything is good. I have 175 boxes to input. Hence the need for a macro
that will loop through the boxes. I could write out each in vba I am just
trying to save myself hours of typing.
--
Thanks!
Shane W


"Nigel" wrote:

Use the Controls function on the form, the following illustrates identifying
each control called ComboBox1 to ComboBox3

Dim xControl As Integer
For xControl = 1 To 3
Controls("ComboBox" & xControl).Enabled = False
Next


--
Cheers
Nigel



"whylite" wrote in message
...
I have many combobox's and would like to change there values. Rather than
listing everysingle one in vba I would like to use a interger and have it
cycle through all of the combobox's and update them with a list. Any

idea's
how I can write the code.

--
Thanks!
Shane W






All times are GMT +1. The time now is 02:35 AM.

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