#1   Report Post  
Posted to microsoft.public.excel.programming
amy amy is offline
external usenet poster
 
Posts: 10
Default Event Macro

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
amy amy is offline
external usenet poster
 
Posts: 10
Default Event Macro

Hi bigwheel,

The macro is activating when any value in any cell is
changed.

Can it be set up so that only values in the range of cells
is changed?

Thanks
-----Original Message-----
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




.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Event Macro help Scott Excel Discussion (Misc queries) 3 March 22nd 10 07:19 PM
Event Macro running another macro inside K1KKKA Excel Discussion (Misc queries) 1 December 20th 06 08:21 PM
'Event' macro George Gee New Users to Excel 18 August 27th 05 12:50 PM
Event macro? Kent Excel Programming 5 June 15th 04 02:54 AM
Event macro David McRitchie[_2_] Excel Programming 2 July 16th 03 06:20 PM


All times are GMT +1. The time now is 12:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"