excelnovicehouston
New Member
- Joined
- Feb 5, 2009
- Messages
- 44
Hi,
I am try to do the following.
in excel I have a cell A1 = "IF(day>6, day+5, 6)"
i have a vba code
(ineq = the above IF equation)
function helpday(ineq)
day = sheet1.range("A5")
month = sheet1.range("A6")
helpday = evaluate(ineq)
End if
I want excel to evaluate this function, but it does not unless I do a replace(ineq, "day",day). however, I want the user to be able to change the equation from IF(day,x,y) to something like IF(month,x,y) and not have the code break without me adding a replace(month).... can excel do this?
many thanks for the help.
I am try to do the following.
in excel I have a cell A1 = "IF(day>6, day+5, 6)"
i have a vba code
(ineq = the above IF equation)
function helpday(ineq)
day = sheet1.range("A5")
month = sheet1.range("A6")
helpday = evaluate(ineq)
End if
I want excel to evaluate this function, but it does not unless I do a replace(ineq, "day",day). however, I want the user to be able to change the equation from IF(day,x,y) to something like IF(month,x,y) and not have the code break without me adding a replace(month).... can excel do this?
many thanks for the help.