+ Reply to Thread
Results 1 to 6 of 6

Clearing the contents of a cell based on updates values of other cells

  1. #1
    Registered User
    Join Date
    11-28-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    75

    Clearing the contents of a cell based on updates values of other cells

    Hello,

    Is it possible to clear the contents of say cell A4 (which is a drop down list that is displayed based on the contents of cells A1:A3) based on the condition if the contents of cells A1:A3 have been changed/updated?

    The problem is that I don't want the user to be able to select some criteria for cell A4, then go back and change/update the dependent-upon contents of cells A1:A3 then forgetting to update the contents of A4.

    Can this be done without a macro?

    Thanks

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Clearing the contents of a cell based on updates values of other cells

    No. It requires VBA code. Data validation lists will update if changes are made to the source range, but prior selections will not update or clear.

    You could use conditional formatting to set the cell fill color when A1:A3 change by using a formula like so:

    =isnumber(match(A4:A1:a3,0))

    This would highlight the cell as a visual flag.
    Alternately, if you have an adjacent cell avaiable, such as B4, you could test A4 against A1:A3 and display a brief message"

    =if(isnumber(match(A4:A1:A3))=false,"update A1:A3 cells","")
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    11-28-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: Clearing the contents of a cell based on updates values of other cells

    Thank you very much for the helpful feedback. Could you please post a VBA code of how to do that? Thanks

  4. #4
    Registered User
    Join Date
    11-28-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: Clearing the contents of a cell based on updates values of other cells

    Can anybody help please?

  5. #5
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Clearing the contents of a cell based on updates values of other cells

    Please Login or Register  to view this content.
    The code must go into the worksheet code module.
    Right-click the tab of the target worksheet, choose View Code then copy and paste the above code into the code pane.
    Close the VB Editor.

    Anytime a change is made to cell A1:A3, cell A4 will be cleared.

  6. #6
    Registered User
    Join Date
    11-28-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: Clearing the contents of a cell based on updates values of other cells

    Thank you very, very much

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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