Private Sub Worksheet_Change(ByVal Target As Range)

brans1982

Active Member
Joined
Mar 25, 2009
Messages
263
Hi,

Not sure how to do this.

i just want to prompt the user with...

MsgBox"Weight Descrpency.",vbexclamation,"""

...if the value in Column A does not match the corresponding value in Column B. I can't use Data Validation as I just want to tell the user the values are different, they don't have to be the same.

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False

Select Case Target.Column

Case 1

If Target.Value <> ................ Then

MsgBox"Weight Descrpency.",vbexclamation,"""

End If

Application.EnableEvents = True

End Sub

Thanks.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Try

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
    If Target.Value <> Target.Offset(, 1).Value Then MsgBox "Discrepancy"
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
Members
453,021
Latest member
Justyna P

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