View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
[email protected] lhkittle@comcast.net is offline
external usenet poster
 
Posts: 168
Default COMPARING TWO COLUMNS AND DISPLAYING MSGBOX

On Saturday, December 15, 2012 12:28:56 AM UTC-8, naga rajan wrote:
Hello everyone,



Am having two values in A1 and B1.

The cell C1 has one value.

I need a msgbox to pop up if either A1 or B1 greater than C1.

Please help.


Hi naga rajan,

Try this in the worksheet code module.

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A1").Value Or Range("B1").Value Range("C1") Then
MsgBox "A1 or B1 is greater than C1", vbOKOnly, "High Hopes"
End If
End Sub

HTH
Regards,
Howard