+ Reply to Thread
Results 1 to 10 of 10

ClearContent of cell when another cell on the row changes via formula

  1. #1
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    ClearContent of cell when another cell on the row changes via formula

    Hi all,
    I want to clear cells E and H when cell B (on the same row) changes via formula.

    I have a formula that will change if I physically change the cell but it won't work when it changes via a formula. Can anyone help with this?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: ClearContent of cell when another cell on the row changes via formula

    .
    This seems to work well :

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Re: ClearContent of cell when another cell on the row changes via formula

    Hi Logit,
    That works perfectly for my needs. Thanks for the help!

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: ClearContent of cell when another cell on the row changes via formula

    You are welcome.

  5. #5
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Re: ClearContent of cell when another cell on the row changes via formula

    Hi Logit,
    I've just noticed something a bit odd which I wasn't expecting. It seems to delete the entire columns when I make a change when I only really want the data on the same row that was changed to be deleted.

    Please Login or Register  to view this content.
    So when cell C605 is changed I only want cells E605, H605, K605, N605 and Z605 but it's deleting everything in E,H,K,N & Z

    How would I fix this.

    EDIT:
    On closer inspection I think something else is causing this bug. Something is causing the chosen columns to delete when entering a new line. I'll upload an example now so you can see what I mean.
    Last edited by jimmisavage; 05-17-2018 at 03:47 AM.

  6. #6
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Re: ClearContent of cell when another cell on the row changes via formula

    The word document shows what I mean and I've also attached a test.xlsm so you can see it happen yourself.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Re: ClearContent of cell when another cell on the row changes via formula

    If Logit isn't available can anyone else suggest any edits here? I've tried everything I can think of but with no luck

  8. #8
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: ClearContent of cell when another cell on the row changes via formula

    .
    jimmisavage

    I can't reproduce the error here on my example workbook attached above.

    I downloaded your file and verified what you are experiencing there ... it deletes everything in the column.

    The only difference I can visualize between your workbook and mine involves your formulas referencing data on another sheet. I changed my example workbook to pickup on
    a cell data change from another sheet .... it still functions as it should (on my workbook).


    The only thing I can imagine (although there may be some other reason ...) is something has become corrupted in your workbook. What that is would be difficult to determine.


    I tried running a small "error cleaner process" on your workbook but the process doesn't recognize that your workbook even exists. That has never occurred before with that small cleaner
    program. In the past, if there were no errors to correct it would state such - it has never said (basically) 'I can't find that workbook.' Very odd.

    Consider creating a new workbook from scratch. Do not copy and paste anything from your existing workbooks because you'll most likely copy what ever is causing the error. See if that
    helps. Just create something with 10 or 20 rows to test. I hope that will clear up the issue.

  9. #9
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Re: ClearContent of cell when another cell on the row changes via formula

    Hi Logit,
    I seem to have fixed the problem!
    I tried starting from scratch but still didn't get the required outcome - it was still deleting everything for whatever reason.

    When trying to work out how best to use the reference cell i decided to add a vba code to populate that cell when it was needed. This simple change fixed the issue! Before I was referencing another cell to get the reference but not it's inputted directly it's working like a charm.

    Thanks again for the help. I appreciate the time you guys put in

  10. #10
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: ClearContent of cell when another cell on the row changes via formula

    .
    Glad you found a fix for the issue.

    You are welcome.

    Cheers.

+ 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] Need advise with clearcontent with specified range - VBA
    By onp in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2018, 10:36 PM
  2. CurrentRegion.ClearContent Not Working
    By NeedForExcel in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-10-2016, 03:09 AM
  3. [SOLVED] ClearContent in another worksheet range using VBA
    By dgraham62 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-03-2016, 11:03 AM
  4. [SOLVED] ClearContent
    By avw84 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-15-2015, 03:07 AM
  5. Clearcontent not working
    By Emma_B in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-10-2013, 06:23 AM
  6. Clearcontent not working
    By Emma_B in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2013, 05:19 AM
  7. ClearContent & 'Cannot change part of a merged cell' error
    By Richard in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-27-2005, 04:05 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