+ Reply to Thread
Results 1 to 5 of 5

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

  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.

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

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

    You might be better attaching a sample with the code that people with different versions could test out.

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

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

    Hi kersplash,
    Thanks for your prompt response.
    I use the workbook for my financial planning and so it contains shedloads of sensitive data but I have extracted a few sheets and sanitised it.

    The function is normally held in a separate workbook saved as an add-in but will exhibit the same behaviour if stored locally in a workbook module which is what I have done.

    I have attached the file with explanations and instructions on how to reproduce the error which, on my machine, exhibits the problem.
    Attached Files Attached Files
    Last edited by Tegglet; 03-02-2018 at 10:46 AM.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

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

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

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

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

    I think I have just done that ;-). Not very friendly. :-(

+ Reply to Thread

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. 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