Yes, you need the Worksheet_Change event procedure. Example:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$C$4" Then Exit Sub
' Replace next line with your code
MsgBox "You changed " & Target.Address(False, False)
End Sub
I need to have the excel cell (say A2) accept only one value,say "ABC".The cell should not accept any other value except "ABC".Could someone help me with the code?
Thank you very much, but i want to use VB code to do this.
I need to do validate 20 cells with different criteria.
For eg.,I need one cell to accept any of the two values,say "ABC" or "DEF"
i.e.,the particular cell should accept any of those two values only and if any thing is typed other than these two strings then it should n't allow the person to enter the value....
It may seem very basic but I an amateur and keen to learn macros.
Please help me here..
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.