+ Reply to Thread
Results 1 to 4 of 4

Clear data in one cell if another is not empty

  1. #1
    Registered User
    Join Date
    12-08-2014
    Location
    Poland
    MS-Off Ver
    2013
    Posts
    87

    Clear data in one cell if another is not empty

    Hi,

    I have a table that has 2 columns with dates. I would like to have a macro that clears the date cell under certain conditions. So first I enter the date in column B, and if I enter the date in column C for project A, the cell with the date in column B should be clean (and still have the date format). And if I re-enter the date in column B for project A, the date in column C should be clean and still have the date format. The macro should work for every project in the table.

    Thank you for your help.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: Clear data in one cell if another is not empty

    Try this:

    Please Login or Register  to view this content.
    But the code only deals with change in one cell at a time.
    If you need it to handle changes in multiple cells at once, like when you copy and paste multiple cells into the range, then you need another code. Let me know if this is the case.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    12-08-2014
    Location
    Poland
    MS-Off Ver
    2013
    Posts
    87

    Re: Clear data in one cell if another is not empty

    Thanks for your help ! Works well

  4. #4
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: Clear data in one cell if another is not empty

    You're welcome, glad to help, & thanks for the feedback.

+ 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. clear empty cells and move data left on array
    By bjorkie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-15-2017, 08:35 AM
  2. Clear many empty tables of data
    By salmasaied in forum Excel Programming / VBA / Macros
    Replies: 42
    Last Post: 11-22-2016, 06:12 PM
  3. [SOLVED] Clear contents from all Rows below the last non-empty cell of a column
    By Dan3456 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-05-2016, 09:28 AM
  4. [SOLVED] Clear cells based on another empty cell
    By coach.32 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-11-2014, 05:43 AM
  5. Macro to clear row data then shift remaining data up to empty rows.
    By clarmech in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-15-2014, 04:35 PM
  6. [SOLVED] VBA code to automatically clear a cells contents when another cell is empty
    By masso1980 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-25-2012, 10:52 PM
  7. Clear cells if another cell is empty
    By dk-iceman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-14-2010, 02:56 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