Please some one correct following code in VBA.
cmb = 6
If Sheet1.ComboBox & cmb.Text = "15 Days" Then sl_by = 2
If Sheet1.ComboBox & cmb.Text = "30 Days" Then sl_by = 1
Thank You :)
Printable View
Please some one correct following code in VBA.
cmb = 6
If Sheet1.ComboBox & cmb.Text = "15 Days" Then sl_by = 2
If Sheet1.ComboBox & cmb.Text = "30 Days" Then sl_by = 1
Thank You :)
Thread Moved
deleted.. I understand now and can't help.
What problem do you want to solve with this code?
I think I understand the problem. There are a number of comboboxes named ComboBox1 to say ComboBox9.
VBA doesn't use control arrays so it's a little difficult without writing
If Sheet1.ComboBox6.Text = "15 Days" Then sl_by = 2
dealing with each ComboBox seperately.
vb Code:
cmb = 6 If Sheet1.olebjects("combobox" & cmb).object.Text = "15 Days" Then sl_by = 2 If Sheet1.olebjects("combobox" & cmb).object.Text = "30 Days" Then sl_by = 1
Thank U one and all especially westconn1.
westconn1 reply helped me Thank You once again. I take u for my guru. I am an ameture. Please help me in the following problem.
with the same project, as it may be clear to you I have placed some more controls in my workbook. They include DatePickers, Lables, Combos and CommondButtons etc., and some User Defined Functions. I am trying to distribute my work to my other offices. Some of the systems are not supporting the DatePickers. Probobly the references of VB controls are not activiated on those machines. I would like to give them a bundle of all such controls and UDFs so that tehy can use my workbook as I do on my machine. Help solicited please.
you can export modules with udfs, then import on other machines
a simpler solution, might be to build an excel addin (.xla), which can be distributed to all users
don't know about the datepickers, check for any missing references on machines where they don't work