macro to run a separate macro dependent on value in cell

S

scottwilsonx

Hello again everyone.

I would like some help with writing a code that will do the following:

I have 4 seperate VBA codes that sort my data in different ways. What
want to do is write a separate code that will run a different macr
depending on what value is selected in cell B6.
For example, if b6 =a then it will run macro Run_a, etc

Thanks
Scott
 
B

Bob Phillips

Select Case Range("B6")
Case .Value = "a": macro_a
Case .Value = "b": macro_b
Case .Value = "c": macro_c
Case .Value = "d": macro_d
End Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top