+ Reply to Thread
Results 1 to 3 of 3

VBA to clear contents of one cell if a condition exists in another cell

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2021
    Posts
    974

    VBA to clear contents of one cell if a condition exists in another cell

    I'm looking for a private worksheet change (or similar) macro that would clear the contents of cell L18 if cell L20 equals "TRUE".
    I would be very grateful for any assistance!
    Attached Files Attached Files
    Last edited by lilsnoop; 06-19-2021 at 07:36 AM.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: VBA to clear contents of one cell if a condition exists in another cell

    Something like this without the action when L20 is False.
    Private Sub Worksheet_Change(ByVal Target As Range)
        If Target.Address(0, 0) <> "B11" Then Exit Sub
        Application.EnableEvents = False
        If [L20] Then [L18].ClearContents
        Application.EnableEvents = True
    End Sub

  3. #3
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2021
    Posts
    974

    Re: VBA to clear contents of one cell if a condition exists in another cell

    Thanks Jindon! That did what I needed. Really appreciate your assistance!

+ 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: 9
    Last Post: 01-25-2021, 01:12 PM
  2. How do I remove cell contents if it exists in another cell?
    By matthewm123 in forum Excel General
    Replies: 4
    Last Post: 08-20-2018, 12:35 AM
  3. [SOLVED] Needing VBA code to clear contents of cell when the contents of another cell is cleared
    By jeh0714 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-15-2016, 03:49 PM
  4. Clear merged cell contents in comand button(clear all)
    By mohan_984 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-25-2015, 10:39 AM
  5. Clear cell contents of drop down box based on condition
    By Pami in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-29-2015, 12:05 PM
  6. Code to clear contents of specific cells based upon if key exists in other sheets
    By seputus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2013, 07:25 PM
  7. Clear Contents on Update when other code exists in the Worksheet_Change thingy
    By JRS_ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2011, 12:11 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