+ Reply to Thread
Results 1 to 14 of 14

Evaluate Formula in VBA

  1. #1
    Forum Contributor
    Join Date
    07-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    476

    Evaluate Formula in VBA

    I'm trying to figure out the best way to evaluate this formula into a cells on a relative basis. Hate R1C1, but will do if have to. Thoughts?

    =TEXT(F78,"MMMM YYYY")&IF(IF(COUNTIF(F$7:F78,F78)>1,"V"&COUNTIF(F$7:F78,F78),"")<>""," - "&IF(COUNTIF(F$7:F78,F78)>1,"V"&COUNTIF(F$7:F78,F78),""),"")


    p.s. How do you build nested formulas using the VBA functions?

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Evaluate Formula in VBA

    does this formula give you a correct andwer in a spreadsheet cell. if so

    then you are not using any variabale. then WHAT IS THE NEED OF THE MACRO WHY NOT USE FORMLA AND COPY DOWn particularly the formla is ccomplex

    anhow ses this macro does it satsify you
    the result is on H1. if this is cell is already filled take it some other empty cell
    depends upon congtents and configuration of data, without which it is difficlt to solve your problem

    Please Login or Register  to view this content.
    I am not an expert. better solutions may be available
    $$$$venkat1926$$$$@gmail.com

  3. #3
    Forum Contributor
    Join Date
    07-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    476

    Re: Evaluate Formula in VBA

    The formula does work I'm trying to automate such that everything populates on worksheet change

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Evaluate Formula in VBA

    why can't you put the formula in the cells? you can convert to values afterwards if necessary
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Forum Contributor
    Join Date
    07-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    476

    Re: Evaluate Formula in VBA

    That's what I was thinking, but was hoping there was more direct way?

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Evaluate Formula in VBA

    what's the difference? if your code adds the formula then converts it to a value it's not going to be more noticeable than using Evaluate, and it will be a lot simpler to do! :-)

  7. #7
    Forum Contributor
    Join Date
    07-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    476

    Re: Evaluate Formula in VBA

    Ohhh, so that's my issue it seems like it would be more of a pain, but I admittedly know nothing. So I'm thinking drop all the formulas, then specials cells for formulas, copy paste values? or am I under thinking?
    Last edited by cmore; 10-29-2013 at 09:51 AM.

  8. #8
    Forum Contributor
    Join Date
    07-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    476

    Re: Evaluate Formula in VBA

    Updated file, New problems
    Attached Files Attached Files

  9. #9
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Evaluate Formula in VBA

    wrong thread?

  10. #10
    Forum Contributor
    Join Date
    07-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    476

    Re: Evaluate Formula in VBA

    Yes wrong thread Cannot get ExcelForum to work from home, it's throwing me off, going to try and send formulas to cells then use special cells to copy and paste values, unless there's simpler solution for this?

  11. #11
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Evaluate Formula in VBA

    just assign the formula to the cell(s) then convert to values directly
    Please Login or Register  to view this content.
    for instance

  12. #12
    Forum Contributor
    Join Date
    07-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    476

    Re: Evaluate Formula in VBA

    Duhhh, good call, solved and solved. I just cannot understand how/why we can insert a formula relatively but cannot evaluate so sad.

  13. #13
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Evaluate Formula in VBA

    we put the formula in a specific cell so it has context; the evaluate method belongs to the worksheet or application and has no cell context. therefore you would need to calculate absolute addresses based on which cell you want the value in and then evaluate that formula. way simpler to just put the formula into one or more cells and let excel do its thing :-)

  14. #14
    Forum Contributor
    Join Date
    07-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    476

    Re: Evaluate Formula in VBA

    makes sense! So I'd have to write some script to adjust or write formulas in R1C1. Boo to evaluate, powerful method with slight shortcomings. Thanks for your help. Next phase of my tear down/rebuild has been pretty painful. Will post new topic if needed. Thank you thank you

+ 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. Evaluate formula via VBA
    By fabdav in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-06-2013, 09:45 PM
  2. evaluate formula
    By nicolelschramartin in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-08-2012, 01:23 PM
  3. Formula evaluate
    By eretic in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2009, 12:51 PM
  4. Can You Evaluate My Formula?
    By kingsolo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-18-2008, 04:13 PM
  5. Formula Will Not Evaluate
    By Cecil in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-25-2006, 02:38 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