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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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,214,605
Messages
6,120,476
Members
448,967
Latest member
visheshkotha

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