I am trying to use a formula in a macro to find only number values greater than 89999.
The list is made of job numbers in the 70-80000's for regular jobs, and 90,000 for jobs that should be capitalized. The problem is that some of the 70 & 80000 job numbers have -1, -2 (e.g. 73500-1, etc). The "dash" job numbers remain stored as text whereas the rest are stored as number.
When I input the following formula in excel, it works perfectly:
=IF(AND(ISNONTEXT(B2),((B2>89999))),"Yes","No")
It tells me "Yes" if the job is greater than 90000, and if not, (wether it is less than 89999 or text) it says "No". This helps me then generate a pivot table that pulls only the 90000 jobs.
BUT... When I enter it on my macro as this:
ActiveCell.FormulaR1C1Local= "=IF(AND(ISNONTEXT(B2),((B2>89999))),"Yes","No")"
I get a "Compiling error, expected end of statement" with the word "Yes" highlighted.
How can I make formula work from a macro?
Thanks in advance!
Eli
Bookmarks