Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default Event when a specific cell changes

Hi,

I want to run a macro after a specific cell value changes.
Cell A5 has a dropdown menu from which you have to choose one value.
After selecting I'd like a macro to start.

Have tried Event Workbook_Change but I'm doing something wrong because
it reacts on every cell change.

Cheers,

Harold
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Event when a specific cell changes

That workbook_Change event is going to fire each time you make a change to the
worksheet.

But you can get out of the procedure as soon as you realize you're not changing
the cell you want to check.

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

if target.cells.count 1 then
exit sub 'only one cell at a time
end if

if intersect(target, me.range("A1")) is nothing then
'get out
exit sub
end if

'code to do real stuff here.
End Sub

To check specific cells:
if intersect(target, me.range("A1,c9,x92")) is nothing then
or
for any cell in column A
if intersect(target, me.range("A:A")) is nothing then

mohavv wrote:

Hi,

I want to run a macro after a specific cell value changes.
Cell A5 has a dropdown menu from which you have to choose one value.
After selecting I'd like a macro to start.

Have tried Event Workbook_Change but I'm doing something wrong because
it reacts on every cell change.

Cheers,

Harold


--

Dave Peterson
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
Change Event on a Specific Cell Sashi Excel Worksheet Functions 3 July 20th 07 11:12 PM
change event on specific cell rather than worksheet frendabrenda1 Excel Discussion (Misc queries) 10 September 21st 06 03:37 AM
Link from a specific Cell in Excel to a specific para. in Word CathyK Excel Worksheet Functions 0 August 10th 06 04:40 PM
Event macro that targets specific worksheet retseort Excel Discussion (Misc queries) 3 February 20th 06 02:47 PM
in vba what command is used to determine if a particular cell on a particular sheet changed? some kind of event? how to get the old and new value of the cell? Daniel Excel Worksheet Functions 1 June 23rd 05 07:53 PM


All times are GMT +1. The time now is 07:44 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"