+ Reply to Thread
Results 1 to 5 of 5

VBA Insert Formula Result Into Cell

  1. #1
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    VBA Insert Formula Result Into Cell

    Hi, I wonder whether someone may be able to help me please.

    I'm using the following code to apply a formula to a given cell:

    Please Login or Register  to view this content.
    The code and formula work fine, but I'm now trying to change this, so the result of the formula, rather than the formula itself is shown in the cell.

    From searching I've done, I thought I may be able to change the formula line to the following, but I try to run this I receive a debug error:

    Please Login or Register  to view this content.
    I just wondered whether someone may be able to look at this please and let me know where I've gone wrong.

    Many thanks and kind regards

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: VBA Insert Formula Result Into Cell

    I think this should do the job

    Please Login or Register  to view this content.
    I'm not able to debug the second piece of code. Anyway in most cases it will not work with the same formula that will go in a cell
    Last edited by buran; 02-06-2014 at 09:19 AM.
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: VBA Insert Formula Result Into Cell

    I think probably your formula is too long for Evaluate - maximum allowed is 255 characters - therefore buran's solution will be the best.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  4. #4
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    Re: VBA Insert Formula Result Into Cell

    Hi @buran, thank you very much for taking the time to reply to my post and for the solution which you've put together, it works just fine.

    Once again, many thanks and all the best

  5. #5
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    Re: VBA Insert Formula Result Into Cell

    Hi @Izandol, thank you very much for taking the time to reply to my post. I did wonder whether the formula may be a little too complex, but as you say the solution from @buran is the way to go.

    All the best and kind regards

+ 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. Replies: 4
    Last Post: 12-17-2012, 11:45 PM
  2. Insert calendar result into lock cell
    By emussynski in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-02-2008, 06:51 AM
  3. [SOLVED] Advanced formula - Return result & Show Cell Reference of result
    By Irv in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-05-2006, 10:40 PM
  4. How to insert line on other worksheet depending upon result in cell?
    By Pheasant Plucker® in forum Excel General
    Replies: 4
    Last Post: 03-17-2006, 05:10 AM
  5. [SOLVED] Macro to insert formula result into range with zero values in cell
    By JPS in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-06-2005, 01:05 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