+ Reply to Thread
Results 1 to 11 of 11

Clear cell content based on calculated value in another cell

  1. #1
    Registered User
    Join Date
    08-14-2014
    Location
    Zürich, Switzerland
    MS-Off Ver
    2013
    Posts
    8

    Clear cell content based on calculated value in another cell

    Hi,

    I have the following problem:
    I have formulas in cells K21, K22, K23 and text in cells L21, L22, L23. I would like that whenever the value changes (based on the respective calculation) in either K21, K22 or K23 that the text in L21:L23 in cleared.
    Does anyone have an idea?

    Thanks a lot,

    Paul

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Clear cell content based on calculated value in another cell

    There is no event to recognize a change in a formula value. We would need to know which cell the formula references then set the macro to trigger based upon a change in that cell. We could base it upon any change in any cell but I try not to do that unless absolutely neccessary.

  3. #3
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Clear cell content based on calculated value in another cell

    I'm with stnkynts, and I'm interested to see a solution to this problem. I was thinking something like this at first:

    Please Login or Register  to view this content.
    So if a formula in K21 is =SUM($B$2:$B$4) and I change the value in B2 or B4, this code works great. But obviously the If Statement will never be true if I change B3, even though the value in K21 would change.

    So I guess I would say you could use this if none of your formulas use ranges, but otherwise this isn't the correct solution.

  4. #4
    Registered User
    Join Date
    08-14-2014
    Location
    Zürich, Switzerland
    MS-Off Ver
    2013
    Posts
    8

    Re: Clear cell content based on calculated value in another cell

    thanks for the feedback. Unfortunately the formulas in K21 etc. are dependent on input from other cells that also contain formulas (it is actually a rather extensive profitability calculation and K21 gives the result). Any other thoughts?

  5. #5
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Clear cell content based on calculated value in another cell

    You could always convert the entire thing to VBA, i.e. remove all the formulas from the spreadsheet and do all the calculations in VBA.

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Clear cell content based on calculated value in another cell

    Eventually the formulas go back to a single cell. I would set the change event based upon that cell.

  7. #7
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Clear cell content based on calculated value in another cell

    I'm still not sure that would resolve the issue I mentioned above where if the changed cell is in the middle of a range listed in the formula.

  8. #8
    Registered User
    Join Date
    08-14-2014
    Location
    Zürich, Switzerland
    MS-Off Ver
    2013
    Posts
    8

    Re: Clear cell content based on calculated value in another cell

    Thanks. Unfortunately, it does not go back to a single cell but to a series of values. The values in K21, 22, 23 only change if the profitability (calculated from a series of values) changes to specified thresholds. So I guess that this cannot be done. Thanks anyway for your fast replies.

  9. #9
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Clear cell content based on calculated value in another cell

    I still think it's likely that all of that could be done in VBA, but ok.

  10. #10
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Clear cell content based on calculated value in another cell

    I didn't say it wasn't possible. There just isn't nearly enough information and I hate guessing/assuming. Why don't you submit the workbook for us to look at and test on.
    Last edited by stnkynts; 09-26-2014 at 10:13 AM.

  11. #11
    Registered User
    Join Date
    08-14-2014
    Location
    Zürich, Switzerland
    MS-Off Ver
    2013
    Posts
    8

    Re: Clear cell content based on calculated value in another cell

    Thanks. Unfortunately, I cannot share the file as it is confidential. However, as already said the values in K21, K22, K23 depend on a multitude of cells some of which also are formulas, i.e. there is not a single value that it all goes back to. I will try to clear the file of all confidential info and share with you.
    Thanks for the support. I appreciate.

+ 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: 6
    Last Post: 09-16-2014, 05:50 PM
  2. Replies: 3
    Last Post: 08-16-2014, 09:55 AM
  3. Clear cell content based on another cell calculation
    By zozo23 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2012, 03:10 PM
  4. Average data calculated based on a cell content
    By fmluder93 in forum Excel General
    Replies: 2
    Last Post: 06-16-2010, 07:07 PM
  5. Lock and clear cell content based on another cell's value
    By mohitmahajanin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2008, 06:30 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