+ Reply to Thread
Results 1 to 6 of 6

Change value of cell without removing the formula

  1. #1
    Registered User
    Join Date
    08-08-2016
    Location
    Oslo
    MS-Off Ver
    2013
    Posts
    7

    Change value of cell without removing the formula

    Hi,

    Is there a way to set a cell equal to a value without removing the equation?

    The cell looks like this now:
    =IF(ISERROR(D554);D553;IF(OR(D554<0,65;D548=1);D553;IF(D583=1;D554-0,01;D554)))

    I want to set the value of this cell to 0,95 when someone changes the input of a cell. Then I want it to continue with the formula which is there already (it's a counter which uses iterative calculations).

    Thanks you for any answers!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,893

    Re: Change value of cell without removing the formula

    You cannot have a value and a formula in the same cell - it's one or the other.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-08-2016
    Location
    Oslo
    MS-Off Ver
    2013
    Posts
    7

    Re: Change value of cell without removing the formula

    Hmm, okay. Is there a way where I can change a cell to be 1, then do the iterative calculations, then change it back to 0?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,893

    Re: Change value of cell without removing the formula

    Sorry - I did not notice that this is in the VBA section - my mistake. Someone who is expert in VBA will be able to help you.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Change value of cell without removing the formula

    It is hard to visualize what you are describing.
    I want to set the value of this cell to 0,95 when someone changes the input of a cell. Then I want it to continue with the formula which is there already (it's a counter which uses iterative calculations).
    There are the Goal Seek and/or Solver utilities that will perform that kind of operation. Is that what you are looking for?
    https://support.office.com/en-us/art...3-4f369d6e66c7
    https://support.office.com/en-us/art...d-078f96d1652c
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Registered User
    Join Date
    08-08-2016
    Location
    Oslo
    MS-Off Ver
    2013
    Posts
    7

    Re: Change value of cell without removing the formula

    I think I figured it out. Added this code:
    If Target = Range("D38") Then
    Range("D548").Value = Range("AM310").Value
    End If
    Application.Calculate
    If Range("D548").Value = Range("AM310").Value Then
    Range("D548").Value = Range("AM311").Value
    End If

    Where AM310 is 1 and AM311 is 0. And then my cell checks if D548 is 0 or 1. When you change the input(D38) D548 is 1 and the cell restarts at 0,95, then the code triggers one calculation, which changes the cell and set the checker to 0. Then the 100 iterative calculations are done when the check is 0.

+ 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. [SOLVED] Removing #DIV/0! ERROR from the Cell with formula ???
    By JJFletcher in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2016, 10:54 AM
  2. [SOLVED] How can I freeze a value in a cell with a formula without removing the formula.
    By jnjcobb in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-19-2013, 04:57 PM
  3. [SOLVED] copying cell without removing formula from the cell i copied from
    By raffi123 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-18-2013, 10:09 AM
  4. Need formula for removing words from a cell.
    By Luke Andrews in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-06-2012, 06:11 AM
  5. Replies: 1
    Last Post: 02-14-2012, 05:45 PM
  6. [SOLVED] Clear Cell Without Removing Formula
    By Scott in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-26-2006, 07:15 PM
  7. [SOLVED] Cannot enter formula in a cell after removing a circular formula
    By Big Corona in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-05-2005, 02:06 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