+ Reply to Thread
Results 1 to 4 of 4

Ref error on VBA Range.formula

  1. #1
    Forum Contributor
    Join Date
    10-20-2017
    Location
    London
    MS-Off Ver
    2016
    Posts
    108

    Ref error on VBA Range.formula

    Hi,

    I have a working macro that copies over a sheet to a new workbook.
    It then inserts the formula "=sum(Debtors!I:I)" into range g19 in worksheet directors checklist.
    However, this returns a #REF! error.

    I would understand this error if the reference was wrong but it is correct.
    When i press F2 to enter the cell and then enter, the formula works correctly and the #REF! error disappears.

    Can someone explain what's wrong and how to fix it?



    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor than_gold's Avatar
    Join Date
    10-17-2017
    Location
    Coimbatore India
    MS-Off Ver
    Office 365
    Posts
    646

    Re: Ref error on VBA Range.formula

    wb2.Worksheets("Director Checklist").Range("G19").Formula = "=sum(Debtors!I:I)"
    Try without formula & check auto-calculation is enabled?
    Regards,
    Thangavel D

    Appreciate the help? CLICK *

  3. #3
    Forum Contributor
    Join Date
    10-20-2017
    Location
    London
    MS-Off Ver
    2016
    Posts
    108

    Re: Ref error on VBA Range.formula

    Quote Originally Posted by than_gold View Post
    Try without formula & check auto-calculation is enabled?
    Hi,

    I found the problem. The ref error was correct.

    It is due tot he fact that the formula is entered before the debtor sheet is added.

  4. #4
    Valued Forum Contributor than_gold's Avatar
    Join Date
    10-17-2017
    Location
    Coimbatore India
    MS-Off Ver
    Office 365
    Posts
    646

    Re: Ref error on VBA Range.formula

    ok great, that you found it...

+ 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. [SOLVED] Dynamic named range error - cannot add formula
    By Douglas Carpenter in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-11-2019, 05:29 AM
  2. [SOLVED] Dynamic Range formula Error
    By ddrace in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-22-2017, 12:42 PM
  3. [SOLVED] Set formula for Range and after that error 1004
    By rodich in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2016, 07:56 AM
  4. [SOLVED] Referencing a UDF in Range.Formula Property - NAME#? Error???
    By ilsley_excel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-08-2016, 11:01 AM
  5. [SOLVED] Error formula range empty
    By Berna11 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-15-2015, 04:00 PM
  6. [SOLVED] Deleted Range Error in Formula
    By Sharksfan88 in forum Excel General
    Replies: 5
    Last Post: 06-13-2012, 03:19 AM
  7. Range.Formula becomes error/undefined
    By mikeyfear in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2008, 05:41 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