Link to home
Start Free TrialLog in
Avatar of jeffchmielinski
jeffchmielinski

asked on

A formula in this worksheet contains one or more invalid references

I am using excel 2007 and I have several macros, vba code and formulas.  I will save my workbook and have no problems.  Then when I reopen it, it will give me the error message: "a formula in this worksheet contains one or more invalid references".  Then I if I don't change anything and reopen it, half of the time it does not give me this error message.  I have tried to identify the issues in the worksheets by doing what other people have said.  This includes: hitting F5 and checking the formulas, searching for #REF!, and using vba code to identify the errors.  Can anyone tell me how to get rid of this or how to figure out where the error is?  Thanks.
Avatar of BigBadWolf_000
BigBadWolf_000
Flag of United States of America image

Have you deleted a chart that is linked to data in your workbook. If yes, was the data on a different sheet from your chart?
ASKER CERTIFIED SOLUTION
Avatar of BigBadWolf_000
BigBadWolf_000
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The invalid references are linked somehow to the area of the sheet that contained the deleted chart and you cannot get rid of them even if you delete the entire rows.

What you need to do is this (where the sheet containing the error is named 'MySheet':

1. Backup workbook.
2. Rename the sheet that is causing the problem 'MySheetOld'
3. Create a new sheet 'MySheet' in your workbook.
4. Copy the rows in 'MySheetOld' down to but not including the area that
contained your deleted chart.
5. Paste into exactly the same rows in 'MySheet'.
6. Copy any rows below (but not including) the area in 'MySheetOld'.
7. Paste into exactly the same rows in 'MySheet'.
8. Change any names that point to 'MySheetOld' to point to 'MySheet'
9. On all other sheets in the workbook find and replace 'MySheetOld' in
formulae with 'MySheet'.
10. Save workbook.
11. Delete sheet 'MySheetOld'.
12. Error message should no longer appear.

You may have to play about with this a bit if you are not sure where tha deleted chart was. Usually you can work your way down a sheet, forcing arecalculate (grouping rows is a good and accurate way to do this - just progressively add rows to a group then close and open the group). When you get to the rows that the deleted chart was in the error message will start appearing.

Steps 6 & 7 may be problematic as you may not know where the corrupted
rows end.

Hope this helps
I would especially suggest checking any names / named ranges for the error.  Perhaps data validation and conditional formatting to.  You may have something referncing a range that you deleted (not cleared) and therefore results in this error.