Results 1 to 5 of 5

#N/A” Error Encountered When Copying Formulas in O365 Excel 2016

Threaded View

  1. #1
    Registered User
    Join Date
    12-21-2017
    Location
    Wokingham, England
    MS-Off Ver
    office 365 2013
    Posts
    46

    #N/A” Error Encountered When Copying Formulas in O365 Excel 2016

    I have been using the function shown below in Excel 2013 without any problems. The death and replacement of my computer however has meant that I now have to use Excel 2016. The code does not work properly in Excel 2016 and Excel 2013 is no longer available in my O365 subscription so I am unable to revert.

    When the spreadsheet opens, all appears well but as soon ANY action requiring a recalculation in ANY cell occurs, every cell using the PrevSheet function displays “#N/A Error”. This cannot be put right using Ctl-z and the only way of correcting the problem seems to be double clicking each cell to invoke incell editing then pressing enter. See attachments for the various error messages displayed.

    If the line “Application.Volitile is commented out then the error does not occur but values are not always updated however, they can be updated manually using the corrective procedure above. Behaviour is inconsistent though and it is not always apparent that the value has not been updated.

    Double clicking the cell to show the cells involved in the code highlights the corresponding call reference in the current sheet rather than the previous sheet (see attachment Excel NA Problem Cell Highlight.PNG)

    The code is as follows:
    <<
    Public Function PrevSheet(rCell As Range) As Variant
    Dim wkbkP As Workbook
    Dim whstP As Worksheet
    Set whstP = rCell.Parent
    Set wkbkP = whstP.Parent

    Application.Volatile
    PrevSheet = wkbkP.Worksheets(whstP.Index - 1).Range(rCell.Address).Value
    End Function
    >>

    I have limited skills in VBA programming and the code was offered to me on another forum so I am not sure how it works, or how it is supposed to work. I would appreciate any help as posting the problem on the original forum has not produced any response.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel Solver Encountered an Error
    By roger312 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-14-2021, 03:41 AM
  2. Replies: 1
    Last Post: 09-18-2017, 08:27 AM
  3. copying xls files to excel 2016
    By oskie89 in forum Excel General
    Replies: 2
    Last Post: 06-08-2017, 09:30 AM
  4. Replies: 5
    Last Post: 04-15-2014, 07:48 AM
  5. Excel has encountered a problem and needs to close error while loading workbook
    By Pyro Form in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-13-2012, 02:54 AM
  6. ERROR: Microsoft Office Excel has encountered a problem and needs to close
    By Kathy25 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-03-2011, 09:45 AM
  7. [SOLVED] Excel Error when copying formulas
    By Joe Gieder in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-18-2005, 01:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1