Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox
Hi,
I have a couple of macros which: a) sort a list by client b) sort a list by value I need two options within the combo box and when I choose option "SORT-CLIENT" the first macro is run Thks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox
In two cells, say AA1 and AA2, put the values SORT-CLIENT and SORT-LIST,
select a combobox form the Forms toolbar, and right-click the combox to select Format Control from the menu, and on the Control tab set the Input Range texbox to AA1:AA2, and the Cell link textbox to AA3. OK out. Add this macro to a general code module Sub SortData() If Worksheets("Sheet1").Range("AA3").Value ="SORT-CLIENT" Then SortbyClientMacro Else SortByValueMacro End If End Sub Now go back to the worksheet, right-click the combobox again, select Assign Macro, and assign the above macro to the combobox. -- HTH RP (remove nothere from the email address if mailing direct) "teresa" wrote in message ... Hi, I have a couple of macros which: a) sort a list by client b) sort a list by value I need two options within the combo box and when I choose option "SORT-CLIENT" the first macro is run Thks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox
Thanks Bob - thats very helpful
"Bob Phillips" wrote: In two cells, say AA1 and AA2, put the values SORT-CLIENT and SORT-LIST, select a combobox form the Forms toolbar, and right-click the combox to select Format Control from the menu, and on the Control tab set the Input Range texbox to AA1:AA2, and the Cell link textbox to AA3. OK out. Add this macro to a general code module Sub SortData() If Worksheets("Sheet1").Range("AA3").Value ="SORT-CLIENT" Then SortbyClientMacro Else SortByValueMacro End If End Sub Now go back to the worksheet, right-click the combobox again, select Assign Macro, and assign the above macro to the combobox. -- HTH RP (remove nothere from the email address if mailing direct) "teresa" wrote in message ... Hi, I have a couple of macros which: a) sort a list by client b) sort a list by value I need two options within the combo box and when I choose option "SORT-CLIENT" the first macro is run Thks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox
Ive tried the below - howver doesnt seem to call CL, always calls "Value"
Thanks Private Sub ComboBox1_Change() If Worksheets("Sheet1").Range("AA3").Value = "C" Then Call CL Else Call Value End If End Sub "Bob Phillips" wrote: In two cells, say AA1 and AA2, put the values SORT-CLIENT and SORT-LIST, select a combobox form the Forms toolbar, and right-click the combox to select Format Control from the menu, and on the Control tab set the Input Range texbox to AA1:AA2, and the Cell link textbox to AA3. OK out. Add this macro to a general code module Sub SortData() If Worksheets("Sheet1").Range("AA3").Value ="SORT-CLIENT" Then SortbyClientMacro Else SortByValueMacro End If End Sub Now go back to the worksheet, right-click the combobox again, select Assign Macro, and assign the above macro to the combobox. -- HTH RP (remove nothere from the email address if mailing direct) "teresa" wrote in message ... Hi, I have a couple of macros which: a) sort a list by client b) sort a list by value I need two options within the combo box and when I choose option "SORT-CLIENT" the first macro is run Thks |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox
Try:
Private Sub ComboBox1_Click() If Combobox1.value = "C" Then Call CL Else Call Value End If End Sub -- Regards, Tom Ogilvy "teresa" wrote in message ... Ive tried the below - howver doesnt seem to call CL, always calls "Value" Thanks Private Sub ComboBox1_Change() If Worksheets("Sheet1").Range("AA3").Value = "C" Then Call CL Else Call Value End If End Sub "Bob Phillips" wrote: In two cells, say AA1 and AA2, put the values SORT-CLIENT and SORT-LIST, select a combobox form the Forms toolbar, and right-click the combox to select Format Control from the menu, and on the Control tab set the Input Range texbox to AA1:AA2, and the Cell link textbox to AA3. OK out. Add this macro to a general code module Sub SortData() If Worksheets("Sheet1").Range("AA3").Value ="SORT-CLIENT" Then SortbyClientMacro Else SortByValueMacro End If End Sub Now go back to the worksheet, right-click the combobox again, select Assign Macro, and assign the above macro to the combobox. -- HTH RP (remove nothere from the email address if mailing direct) "teresa" wrote in message ... Hi, I have a couple of macros which: a) sort a list by client b) sort a list by value I need two options within the combo box and when I choose option "SORT-CLIENT" the first macro is run Thks |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox
Thanks Tom - works fine
"Tom Ogilvy" wrote: Try: Private Sub ComboBox1_Click() If Combobox1.value = "C" Then Call CL Else Call Value End If End Sub -- Regards, Tom Ogilvy "teresa" wrote in message ... Ive tried the below - howver doesnt seem to call CL, always calls "Value" Thanks Private Sub ComboBox1_Change() If Worksheets("Sheet1").Range("AA3").Value = "C" Then Call CL Else Call Value End If End Sub "Bob Phillips" wrote: In two cells, say AA1 and AA2, put the values SORT-CLIENT and SORT-LIST, select a combobox form the Forms toolbar, and right-click the combox to select Format Control from the menu, and on the Control tab set the Input Range texbox to AA1:AA2, and the Cell link textbox to AA3. OK out. Add this macro to a general code module Sub SortData() If Worksheets("Sheet1").Range("AA3").Value ="SORT-CLIENT" Then SortbyClientMacro Else SortByValueMacro End If End Sub Now go back to the worksheet, right-click the combobox again, select Assign Macro, and assign the above macro to the combobox. -- HTH RP (remove nothere from the email address if mailing direct) "teresa" wrote in message ... Hi, I have a couple of macros which: a) sort a list by client b) sort a list by value I need two options within the combo box and when I choose option "SORT-CLIENT" the first macro is run Thks |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox
steps:
1. create the combobox 2. populate the combobox 3. assign a routine to a combobox event 4. code the routine Which step are you on? you wrote: I have a couple of macros which: a) sort a list by client b) sort a list by value I need two options within the combo box and when I choose option "SORT-CLIENT" the first macro is run ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =---- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
fill combobox depending on selection from another combobox | Excel Discussion (Misc queries) | |||
combobox changes value | Excel Discussion (Misc queries) | |||
combobox value | Excel Discussion (Misc queries) | |||
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox | Excel Programming | |||
Populating combobox from another combobox | Excel Programming |