Detect cell value changes

nanefy

New Member
Joined
Sep 13, 2005
Messages
47
Hi,

I wonder if someone knows how to do this, as I have scoured the forum and cant really find what I am looking for.

I have two columns A is Category and B is Sub Category i.e.

Input Missing Documents
DMC Archive

Column B uses validation of the form indirect(A1), so that if A1 = input then it will bring up a certain drop down list. Now if they choose Input for A1 and Missing Documents for B1 then change thier mind and Choose DMC for A1 but leave Missing Documents in B1 then B1 does not contain the correct info (this is the users fault). I want to prevent this. Is there a way to check and see if A1 has changed and if so clear the contents of B1 so that they have to re-select.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
You could put this code the worksheet module where you list is.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$B$5" Then
    Range("C5").ClearContents
End If
End Sub

Assuming your first drop down is in B5 and you second is in C5
then you could use conditional formatting to make the cell red if it is blank.
 
Upvote 0
Hi,

Thats great, however I dont want to hardcode the cells into the code. Although my example used A1 & B1 I want it to effect all the cells in A1 & B1. How is this done?
 
Upvote 0
This will clear the contents of the cell directly to whatever cell is selected in column A

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then
    Set c = ActiveCell
    c.Offset(0, 1).ClearContents
    End If
End Sub


:cool:
 
Upvote 0

Forum statistics

Threads
1,219,161
Messages
6,146,657
Members
450,706
Latest member
LGVBPP

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