ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro to run a separate macro dependent on value in cell (https://www.excelbanter.com/excel-programming/305020-macro-run-separate-macro-dependent-value-cell.html)

scottwilsonx[_13_]

macro to run a separate macro dependent on value in cell
 
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

--
Message posted from http://www.ExcelForum.com


Don Guillett[_4_]

macro to run a separate macro dependent on value in cell
 
how about

if ucase(range("b6"))="A" then call Run_a


--
Don Guillett
SalesAid Software

"scottwilsonx " wrote in
message ...
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 I
want to do is write a separate code that will run a different macro
depending on what value is selected in cell B6.
For example, if b6 =a then it will run macro Run_a, etc

Thanks
Scott.


---
Message posted from
http://www.ExcelForum.com/




Bob Phillips[_6_]

macro to run a separate macro dependent on value in cell
 
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)

"scottwilsonx " wrote in
message ...
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 I
want to do is write a separate code that will run a different macro
depending on what value is selected in cell B6.
For example, if b6 =a then it will run macro Run_a, etc

Thanks
Scott.


---
Message posted from http://www.ExcelForum.com/




scottwilsonx[_14_]

macro to run a separate macro dependent on value in cell
 
Thanks both. All working perfectly.

Scott

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 10:25 PM.

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