ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formula defines range or runs macro (https://www.excelbanter.com/excel-programming/278112-formula-defines-range-runs-macro.html)

Mike[_52_]

Formula defines range or runs macro
 
We are trying to find a way to change a range name area based on the data in
a cell. For instance if cell A5=10 it will change a defined range name
"motor" to specific cells B10:C15 on another sheet. If cell A5 is then
changed to 20 the range name will change to B10: C25 etc.

Another option we could use is if cell A5=10 run a specific macro. We have
tried to write a conditional statement that will fire the macro when a
condition is met but that didn't work. Does anyone have any ideas on how to
make this work? Thanks in advance for any assistance you can provide.



J.E. McGimpsey

Formula defines range or runs macro
 
one way:

Choose Insert/Name/Define

enter motor in the Name in workbook: field, and in the Refers to:
field enter:

=OFFSET('Sheet2'!$B$10,0,0,'Sheet1'!$A$5-4,2)

Adjust your sheet names to suit...

In article ,
"Mike" wrote:

We are trying to find a way to change a range name area based on the data in
a cell. For instance if cell A5=10 it will change a defined range name
"motor" to specific cells B10:C15 on another sheet. If cell A5 is then
changed to 20 the range name will change to B10: C25 etc.

Another option we could use is if cell A5=10 run a specific macro. We have
tried to write a conditional statement that will fire the macro when a
condition is met but that didn't work. Does anyone have any ideas on how to
make this work? Thanks in advance for any assistance you can provide.




All times are GMT +1. The time now is 04:28 PM.

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