Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default Worksheet Change Event

Hello. How can I have a worksheet_Change event trigger only when certain
cells (more specifically - when a cell with a certain range of cells) are
changed? Thanks!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Worksheet Change Event

I don't think it is possible: the range object doesn't have any event that
can be triggered.
You have to understand what range generated the event inside the
worksheet_change event.

Paolo


"Steph" ha scritto nel messaggio
...
Hello. How can I have a worksheet_Change event trigger only when certain
cells (more specifically - when a cell with a certain range of cells) are
changed? Thanks!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Worksheet Change Event

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C1:C5")) Is Nothing Then
MsgBox "Changed!"
End If
End Sub

Take care because Target may not always be just the single cell.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Steph" wrote in message
...
Hello. How can I have a worksheet_Change event trigger only when certain
cells (more specifically - when a cell with a certain range of cells) are
changed? Thanks!




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Worksheet Change Event

What are the cells?

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
MsgBox ("ACTIVE")
Else
End If
End Sub

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Worksheet Change Event

Ooh..his is better.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default Worksheet Change Event

Thanks so much Rob! Can I ask a follow up to your post on the other message
I posted regarding the "before event"?

You posted "You must store the value separately as the cell changes so you
can refer to
the value at next change." How would I go about doing that? My goal in
this is to create a change log on a worksheet that multiple people will be
changing. Thanks again for your help!!


"Rob van Gelder" wrote in message
...
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C1:C5")) Is Nothing Then
MsgBox "Changed!"
End If
End Sub

Take care because Target may not always be just the single cell.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Steph" wrote in message
...
Hello. How can I have a worksheet_Change event trigger only when

certain
cells (more specifically - when a cell with a certain range of cells)

are
changed? Thanks!






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Worksheet Change Event

You're welcome.

You should really stick to the original thread.

I've never done change tracking this way before. I'm concerned I couldn't
capture every change - I could be wrong..

If I were to give it a serious go, I might create a two column table. First
row for cell address, Second row for previous value. Kind of like a
transaction log.
I'd recommend using Excel's built in Track Changes feature.


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Steph" wrote in message
...
Thanks so much Rob! Can I ask a follow up to your post on the other
message
I posted regarding the "before event"?

You posted "You must store the value separately as the cell changes so
you
can refer to
the value at next change." How would I go about doing that? My goal in
this is to create a change log on a worksheet that multiple people will be
changing. Thanks again for your help!!


"Rob van Gelder" wrote in message
...
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C1:C5")) Is Nothing Then
MsgBox "Changed!"
End If
End Sub

Take care because Target may not always be just the single cell.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Steph" wrote in message
...
Hello. How can I have a worksheet_Change event trigger only when

certain
cells (more specifically - when a cell with a certain range of cells)

are
changed? 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
Worksheet Change event LAF Excel Discussion (Misc queries) 3 January 4th 06 02:08 AM
Worksheet Change Event DCSwearingen Excel Discussion (Misc queries) 1 October 10th 05 10:25 PM
Worksheet Change event Libby Excel Programming 2 October 26th 04 12:02 AM
Change Cell from Validated List Not Firing Worksheet Change Event [email protected] Excel Programming 3 October 4th 04 03:00 AM
Worksheet change event Helen Trim[_3_] Excel Programming 0 September 23rd 03 03:00 PM


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