Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default On Edit activation

Can anyone tell me a way to have a macro execute based on the value of a
cell changing?


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default On Edit activation

Hi tjb21045!


Try something like:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$a$1" Then Exit Sub
<<Your Code
End Sub

This is placed in the Sheet Module where the target cell is located.
Easiest means of access is to right click the sheet tab and select
View Code. If you click the left drop down above the code window and
select Worksheet and then click the right drop down and select Change,
you'll find that your macro is topped and tailed correctly.

I think that you'll find a Google search on Worksheet Change will give
you lots of examples.

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia

Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
"tjb21045" wrote in message
...
Can anyone tell me a way to have a macro execute based on the value

of a
cell changing?


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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default On Edit activation

You could use the sheet change event:

http://support.microsoft.com/default...23&Product=xlw

--
Jim Rech
Excel MVP


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default On Edit activation

Your if test will always be evaluated as true as written as the address
comes back as $A$1 (unless you set Option Compare Text).

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$1" Then Exit Sub
<<Your Code
End Sub

--
Regards,
Tom Ogilvy


Norman Harker wrote in message
...
Hi tjb21045!


Try something like:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$a$1" Then Exit Sub
<<Your Code
End Sub

This is placed in the Sheet Module where the target cell is located.
Easiest means of access is to right click the sheet tab and select
View Code. If you click the left drop down above the code window and
select Worksheet and then click the right drop down and select Change,
you'll find that your macro is topped and tailed correctly.

I think that you'll find a Google search on Worksheet Change will give
you lots of examples.

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia

Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
"tjb21045" wrote in message
...
Can anyone tell me a way to have a macro execute based on the value

of a
cell changing?


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





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
activation key LewisT Excel Discussion (Misc queries) 2 March 24th 10 05:27 AM
Activation Request Harry Excel Discussion (Misc queries) 2 September 15th 07 05:22 AM
"combination drop-down edit " form activation in Excel Trev Excel Discussion (Misc queries) 1 March 4th 05 03:26 AM
program activation Lawson Excel Programming 2 October 30th 03 02:34 PM
Ctl-X activation of macros John Baker Excel Programming 1 October 17th 03 09:24 PM


All times are GMT +1. The time now is 12:59 AM.

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"