Solved: rules form a sheet

cdkeito

Board Regular
Joined
Aug 26, 2005
Messages
95
Hi all

a little question for you:

Can a macro use a rule (a=0 and b<3 or c+5 = d) writen in the sheet?

I think it must be something like eval(CStr(rule)).

Grrraaaaaaaaaaaaaaazie!
 

acw

MrExcel MVP
Joined
Feb 13, 2004
Messages
4,814
Hi

I'm assuming that a,b and d are defined names. c will have to be something else as it is reserved (cc perhaps). Also you will have to change the "rule" to be in excel format so if

A6: OR(AND(a=0,b<3),cc+5 = d)

Code:
rule = range("a6")
msgbox evaluate(rule)
HTH

Tony
 

Forum statistics

Threads
1,078,006
Messages
5,337,694
Members
399,162
Latest member
Sabina

Some videos you may like

This Week's Hot Topics

Top