+ Reply to Thread
Results 1 to 3 of 3

#Value error on entering a formula using VBA

  1. #1
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    #Value error on entering a formula using VBA

    Hi all,

    I've been struggling with this particular query for a couple of hours now, have googled plently, recorded a macro, inserted "'s and &'s all over the place but not been able to find a solution.

    I have a table within a spreadsheet which uses various sumproduct / indirect / match formulas to collate data from underlying spreadsheets. The formulas are entered by clicking on an update button, calculating then overpasting with the values (keeps it small in size and runs nice and quick).

    All but one of the formulas are working fine - with double quotations all over the place - but this particular one is returning a #value error which I can fix by removing the quotation marks in the formula bar. I cannot however get the right combination in VBA code to enter the formula in a way that works, please help!

    Code:

    Please Login or Register  to view this content.
    Formula bar (cell displays #value):

    Please Login or Register  to view this content.
    This is the formula I'm trying to reach:

    Please Login or Register  to view this content.
    Any help appreciated...

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: #Value error on entering a formula using VBA

    Hi, this is not tested so I have no idea if it will work but try
    Please Login or Register  to view this content.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    Re: #Value error on entering a formula using VBA

    Thanks Mordred - didn't quite work, returned FALSE, but with a tweak it's perfect!

    Please Login or Register  to view this content.
    I was under the imrpession (and I'm damn sure it did when I tried before) that apostophes throw out errors as VBA thinks of them as annotation. But this works and I'm taking it - thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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