Macro to clear contents of cell two columns along in the same row if value changes

cutleryhands

New Member
Joined
Feb 19, 2018
Messages
2
Hi All

So, I have dates in column A and dates in column C.

I need C to be cleared in the event A is changed.

I also need this to work all rows. I have been trying for a few days copying other solutions that look close and jave been trying to learn aswell but I need this quicker than I appear to be able to figure it out myself.

Any help would be appreciated.

Cutlery....
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Welcome to the board.

Here is a basic worksheet_change event code that will clear the contents of specific row in Col C if the same row value in Col A changes. Now, this is just the starting piece and you will have to make additions to this so it doesn't just clear Col C because you clicked in a cell to edit in Col A.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
    Range("C" & Target.Row).Clear
End If
End Sub
 
Upvote 0
Many thanks Dreid.

I am getting some joy but wondered, I have it working for manually changing or deleting the cell value.

However, if the value in A is linked and changed via the linked workbook then it does not clear the value in row C ?

Cutlery
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top