+ Reply to Thread
Results 1 to 5 of 5

Evaluate an Excel function stored in a string in VBA

  1. #1
    Registered User
    Join Date
    02-17-2022
    Location
    Malta
    MS-Off Ver
    2016
    Posts
    6

    Evaluate an Excel function stored in a string in VBA

    Hi,

    I have the following code snippet

    Please Login or Register  to view this content.
    Can I do this?

    Thanks

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,530

    Re: Evaluate an Excel function stored in a string in VBA

    There is no need for a worksheet function to do this. I'm not sure what you are trying to do with functionStr.

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    02-17-2022
    Location
    Malta
    MS-Off Ver
    2016
    Posts
    6

    Re: Evaluate an Excel function stored in a string in VBA

    Quote Originally Posted by 6StringJazzer View Post
    There is no need for a worksheet function to do this. I'm not sure what you are trying to do with functionStr.

    Please Login or Register  to view this content.
    My need is not focused on just IsEven.

    I want to be able to work with any formula. The workaround I have found is to compute the formula into a cell and than pick up the value.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,530

    Re: Evaluate an Excel function stored in a string in VBA

    It's still not clear what you need since you are using the VBA function Application.WorksheetFunction.IsEven. You can't evaluate that as part of a string.

    Do mean something like this? This evaluates a string that can be used as a worksheet formula.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-17-2022
    Location
    Malta
    MS-Off Ver
    2016
    Posts
    6

    Smile Re: Evaluate an Excel function stored in a string in VBA

    Quote Originally Posted by 6StringJazzer View Post
    It's still not clear what you need since you are using the VBA function Application.WorksheetFunction.IsEven. You can't evaluate that as part of a string.

    Do mean something like this? This evaluates a string that can be used as a worksheet formula.

    Please Login or Register  to view this content.
    This is exactly what I need. Works. Thank you.

    Thanks
    Last edited by acb7865; 02-18-2022 at 04:37 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. Using a String in Evaluate function
    By Vlad717 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-20-2017, 07:43 PM
  2. [SOLVED] EVALUATE an R1C1 formula currently stored in an array
    By JBeaucaire in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-07-2016, 11:01 PM
  3. Return Stored function in Access from Excel
    By jrdnoland in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-11-2014, 04:16 AM
  4. Type 13 Runtime Error Using String Variable in Evaluate Function
    By VBADoesMyWork in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-12-2014, 02:24 AM
  5. Evaluate String using function
    By graspindia in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-24-2008, 01:58 AM
  6. Evaluate text string as a function
    By benb in forum Excel General
    Replies: 3
    Last Post: 07-19-2006, 09:45 AM
  7. How to evaluate string?
    By Boban in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-04-2005, 02:21 PM

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