Evaluate() is returning an "Error 2007"

jcg31

Board Regular
Joined
Aug 20, 2006
Messages
176
I am using the Evaluate function to return a value from a string. The string being evaluated is "(AC379+AC380+AC381)/AC385"

The cells hold the values of 193, 22703, 312 & 315322 respectively. The first three are comma formated (accounting with commas, no $ signs) the last number in the series is formated Accounting.

When the evaluate function is run it returns an "Error 2007" value. Anyone have any idea why and how to correct?

Thanks for any help.
Jim
 
Hmmm that will take some rework to append that to the string, but will give it a shot tonight. Thanks,
Jim
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Jim

Why are you using Evaluate?
Just wondering if there's some other approach that would give the same results.
 
Upvote 0
Jim

Why are you using Evaluate?
Just wondering if there's some other approach that would give the same results.

I manage a division of businesses that is one of five other divisions. Each month I receive a report that contains a full P&L and other performance metrics. Each of the businesses in all the divisions is placed on a single spreadsheet in adjacent columns with the rows containing the various accounts or metrics. The application allows me to review the data in interesting and unlimited ways by selecting any line item (also via dropdown) and then using operands (also via dropdown) to construct a formula that is pressed across companies, months and years to return a ranked (if needed) presentation of any measure I can construct. So if I want to see how each business ranks according to the greatest ratio of product sold per salesperson divided by the number of complaints per CSR multiplied by the square root of the number of department heads employed as of June, I can, or will once I fix this division problem I am currently experiencing.

Thanks,
Jim
 
Upvote 0
Another oddity to this that may provide a clue to someone. The numbers on these spreadsheets are populated from a database (that I don't have access to). If I go into the cells and type in the numbers (over the existing ones), then the script works as it should.

Worksheets("SummarySheet").cells(1,1) = Worksheets(Worksheets("sheet1").Evaluate("(A1+A2+A3)/A4")
 
Upvote 0
Sounds like the data from the database isn't being imported properly so the 'numbers' aren't being recognised as such.

The two formula based solutions should work but it might be worth seeing if it's possible to 'fix' the data itself.
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top