+ Reply to Thread
Results 1 to 4 of 4

Cell Formula in VBA "Flattened"

  1. #1
    Registered User
    Join Date
    02-02-2011
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    18

    Cell Formula in VBA "Flattened"

    Okay,

    So, I've a question!

    I was wondering if there's a way to write a Cell formula in VBA and essentially have it be flattened so that when referencing that cell it looks just like the result of the formula and not the formula itself.

    So, essentially, if I wrote a really simple concatenation or did one with & the cell would only exist as the result of the formula.

    So, a simple example might be

    =A1+A2, where A1 is 1 and A2 is 2. The result is obviously 3, however, when accessing the cell it's the original formula as opposed to the result and I'm looking just for the result.

    Thanks!

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: Cell Formula in VBA "Flattened"

    It's not really clear what you are asking but it could be this.

    Please Login or Register  to view this content.
    Although once you update the cell with a static value changes in A1 or A2 will not be reflected in A3
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Cell Formula in VBA "Flattened"

    You could select the entire spreadsheet and then Copy>Paste Special > Values.
    Now all your formulas have been replaced by constants.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    02-02-2011
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Cell Formula in VBA "Flattened"

    Okay, that works...


    Now, how do I increment the cells in the formula? So, how do I make A1 become B1 in that same formula over and over again?
    Last edited by indijonesjames; 02-03-2011 at 01:23 PM.

+ 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