Thread: Event Macro
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bigwheel Bigwheel is offline
external usenet poster
 
Posts: 14
Default Event Macro

Hi Amy

this will help if the data is changed ...

Private Sub Worksheet_Change(ByVal Target As Range)
If [a3] [a2] Then
report = MsgBox("Something else has changed", vbInformation)
ElseIf [a2] [a1] Then
report = MsgBox("Something's changed", vbInformation)
End If
End Sub

This code to be added to the relevant sheet. Replace the msgbox with the
call to your macro.

If you need somthing to happen when you activate the sheet, change
"Worksheet_Change(ByVal Target As Range)"
to "Worksheet_Activate()"


"Amy" wrote in message
...
Can someone please help me with some code please?

I am trying to create a event macro every time the
workbook is activated and if data is changed from cells A1
thru A4. I want a macro to check these range of cells and
call on another macro when a certain condition is met. In
this case I have the following data

Column A

95
93
null
null

I want the macro to look at the most bottom data in the
four cells and call on a macro if cell A2 is grater than
cell A1.

Now in time data will be entered into cell A3, so when
when data is present in cell A3 I want the macro to be
called if cell A3 is greater than cell A2.

I know this is a little confusing, so any help would be
awesome.

Thanks