This code should be assigned to the FORMS combo box, where cell D9 is the
linked cell. Each time you select a value, D9 gets that value and the code
runs.
Sub RunFromCellValue()
Application.Run Range("D9").Value
End Sub
the catch is that value must correspond to the code to be run
Alternative is to use an index
Sub RunFromCellValue()
select case range("D10") ' where D10 is the position of the selected item
case 1: Call MyProc_1
case 2: Call MyProc_2
case 3: Call Something else
Case Else
End Select
End Sub
If you're using the ActiveX combo box, then simply use the control's
listindex and use the select case method. Note , if the index is -1 then
nothing was selected.
"jbp20717" wrote:
Is it possible to assign a different macro to each item in a drop down
list or not?
I've tried something like this, but I am totally useless with
VisualBasic, so I wouldn't be surprised if its totally meaningless:
Sub Larder2()
'
Select Case ("Larder Prep")
Sheets("Larder Prep").Select
Select Case ("Bakery")
Sheets("Bakery").Select
End Sub
...besides, I want to run a range of macros and not select sheets in
the workbook.
--
jbp20717
------------------------------------------------------------------------
jbp20717's Profile: http://www.excelforum.com/member.php...o&userid=24886
View this thread: http://www.excelforum.com/showthread...hreadid=384257