+ Reply to Thread
Results 1 to 2 of 2

Erase cell if another cell changes

  1. #1
    Registered User
    Join Date
    07-15-2020
    Location
    Prague, CZ
    MS-Off Ver
    2010
    Posts
    1

    Erase cell if another cell changes

    Hi all,
    Unfortunately I am not familier with VBA so I would like to ask you for your kind help.
    I have data in column Z where is TRUE or FALSE. No other.
    I need to erase a cell in X column on the same row if FALSE appears in Z column.
    I need to make it in VBA. I cannot use data validation because I already use it for different conditions.
    Thank for any idea.

    The whole what I have is this wrong code:

    Private Sub Worksheet_Change(ByVal Target As Range)

    Set x = ActiveSheet.Range("Z1:Z10")
    Set y = ActiveSheet.Range("X1:X10")

    For Each c In x
    If c.Value <> "TRUE" Then
    y.ClearContents
    End If
    End Sub

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,777

    Re: Erase cell if another cell changes

    Does your sheet contain headers in row 1 with the data starting in row 2?
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

+ 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: 2
    Last Post: 04-16-2020, 03:46 PM
  2. [SOLVED] Erase Value in Adjacent Cell
    By redrocker12 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-11-2018, 02:23 PM
  3. [SOLVED] Erase space in a cell
    By Saturn in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-28-2017, 10:57 AM
  4. [SOLVED] How to erase the name of a cell using macros?
    By luisfmb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2014, 12:41 PM
  5. How to erase some words on a cell?
    By Gravity101 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-21-2013, 07:36 AM
  6. Erase cell value on selection of the cell
    By gajaburu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2013, 07:22 AM
  7. Having a cell subtract from another cell and then erase contents after
    By atlbraves in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2010, 09:26 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