View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Wilson John Wilson is offline
external usenet poster
 
Posts: 550
Default how do I: launch a macro if two cells do not equak one another?

jason,

That event will only fire if something on the worksheet is changed.
What are you changing on the worksheet?
Is there something else in your code where you could call this
procedure (based on your other thread)??
Within your macro, just check the cells???

There are other events that you might use.
A good listing of them can be found he
http://www.cpearson.com/excel/events.htm

John


"jasonsweeney " wrote in
message ...
Its late in the day and I am frustrated not getting this simple
procedure to work:

I need a macro to fire when two cells in two different worksheets do
nto equal one another. Here is my code:

(that does not work....nothing happens at all)
_________
Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Source As Range)

If Worksheets("Sheet1").Range("A2").Value =
Worksheets("Sheet2").Range("D2").Value Then
'
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "values do not match."
Style = vbOKOnly
Title = "No Match"
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
'
'
[lauches new sub routine]
End If
_________________

Do I have the wrong event or something?!


---
Message posted from http://www.ExcelForum.com/