Consulting

Results 1 to 7 of 7

Thread: Formula Error Message in Excel 2007 Sheet

  1. #1

    Formula Error Message in Excel 2007 Sheet

    I'm trying to convert an Excel 2003 workbook to an Excel 2007 workbook, and I keep getting the following error message:
    "A formula in this worksheet contains one or more invalid references.
    Verify that your formulas contain a valid path, workbook, range name, and cell references"

    There is no indication where these invalid references might be, and this worksheet has LOTS of formulas. I clicked the error detection button, but it doesn't do anything. Does anyone have a technique for finding the invalid formulas?

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    [vba]
    Sub Show_All_Sheets_In_Workbook()
    Dim i As Long
    ActiveWorkbook.Unprotect
    For i = 1 To Sheets.Count
    Sheets(i).Unprotect
    Sheets(i).Visible = True
    Next
    End Sub

    Sub Color_Cells_With_Formulas()
    'This will color all Cells containing a fomula in
    ' all sheets in the Active Workbook
    Dim All As Range
    Dim n As Long
    For n = 1 To Sheets.Count
    Sheets(n).Activate
    Sheets(n).Range("A1:IV65536").Select
    Selection.SpecialCells(xlFormulas).Interior.ColorIndex = 3
    Next
    End Sub
    [/vba]

  3. #3
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    [vba]
    Sub Color_Cells_With_Names()
    'This will color all Cells containing a fomula in
    ' all sheets in the Active Workbook
    Dim n As Long
    For n = 1 To ActiveWorkbook.Names.Count
    Range(ActiveWorkbook.Names(n)).Interior.ColorIndex = 5
    Next
    End Sub
    [/vba]

  4. #4
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    [vba]
    Sub AllNummericCells()
    'This will color all cells with
    Dim rFcells As Range
    Dim rAcells As Range
    Dim n As Long
    For n = 1 To Sheets.Count
    Sheets(n).Activate
    'Set variable to all used cells
    Set rAcells = ActiveSheet.UsedRange
    On Error Resume Next 'In case of no numeric formula or constants.
    'Set variable to all numeric formulas
    Set rFcells = rAcells.SpecialCells(xlCellTypeFormulas)
    'Determine which type of numeric data (formulas, constants or none)
    If rFcells Is Nothing Then
    MsgBox "You Worksheet contains no Formulas"
    End
    Else
    Set rAcells = rFcells
    End If
    On Error GoTo 0
    rAcells.Interior.ColorIndex = 8
    Next
    End Sub
    [/vba]

  5. #5
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,057
    Location
    Quote Originally Posted by SamT
    [vba]
    ActiveWorkbook.Unprotect
    ]/vba]
    Hmmmm...... Can you have this line without Excel asking for your password, and if so, have you left the workbook now with not protection?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  6. #6
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    IT worked for me. I understand that in 2007, there is an issue with it.

    Yes, the Workbook is unprotected. Thhose Subs are utilities I wrote to help me troubleshoot other peoples workbooks.

    My own Workbooks never have problems

  7. #7
    Hey, nice work, Sam! I'll get to work on it tomorrow morning. This is the weirdist proplem I've had today, except for trying to assign a macro to a shape (rectangle). I still haven't licked that one. All my old shapes accept assignment OK. (Pffft!)
    Sid

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •