+ Reply to Thread
Results 1 to 5 of 5

Evaluate in VBA not working

  1. #1
    Registered User
    Join Date
    10-17-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    71

    Question Evaluate in VBA not working

    I'm using the below code to place the resulting value in cell A16. However, I get an error, bad syntax, when running the macro. I looked online to try to get the right syntax, but haven't had any luck. Any assistance with modifying the code to work would be much appreciated.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Evaluate in VBA not working

    Did you try Application.Evaluate instead of ActiveSheet.Evaluate?
    If you are happy with my response please click the * in the lower left of my post.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Evaluate in VBA not working

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    10-17-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    71

    Re: Evaluate in VBA not working

    Shg, thanks for the fix, the extra "" worked! One more issue though: I don't get any error when I use the following code:

    Please Login or Register  to view this content.
    However, I get a #Value! result when using the following. This doesn't happen when I input the formula directly into the cell (without using the evaluate VBA function).

    Please Login or Register  to view this content.
    I know the formula is good, but I get a bad result using evaluate in VBA. Any ideas where I'm going wrong on this?

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Evaluate in VBA not working

    I don't, other than that unqualified references (e.g., A31) are interpreted as being on the worksheet active when the line is executed, which makes the code less than robust.
    Last edited by shg; 11-25-2015 at 12:53 PM.

+ 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. Application.Evaluate not working - Array Formula
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-28-2015, 01:12 AM
  2. [SOLVED] 'Evaluate' code not working
    By Woulter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2015, 01:09 AM
  3. vba "evaluate" code not working
    By chiidzzz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-26-2013, 08:32 AM
  4. [SOLVED] Question about Evaluate
    By JohnM3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2012, 11:51 AM
  5. VBA: using Evaluate with sumproduct function ( Date Comparison not working)
    By vidyuthrajesh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-22-2012, 05:36 AM
  6. Function Evaluate
    By raty in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-23-2008, 05:58 AM
  7. Evaluate end of folder name
    By cindy75 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-26-2008, 10:30 AM

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