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

I want to create a simple update flag to show when a particular
worksheet has been updated. I only want to identify when particular
cells have been updated, and have tried the following:


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim rng As Range
Set rng = Me.Range("J15:DM24")

If Not Intersect(rng, Target) Is Nothing Then
Range("C2").Value = True
End If

End Sub

The above code almost works, although it changes C2 to TRUE when any
cell in rng is selected, rather than changed. Close, but not quite
there!!

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Worksheet_SelectionChange

Hi Kerri

Use the Change event, this should do what you want.

Take care

Marcus

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = Range("J15:DM24")

If Not Intersect(Target, rng) Is Nothing Then
Range("C2").Value = True
End If
End Sub
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default Worksheet_SelectionChange

The SelectionChange Event is only fired when you Excel changes focus from one
cell to another. You need an event that will fire when any data within your
range is changed. To do this you need the Change Event. Give this code a
try. Hope this helps! If so, let me know, click "YES" below.

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Me.Range("J15:DM24"), Target) Is Nothing Then
Range("C2").Value = True
End If

End Sub
--
Cheers,
Ryan


"Kerri Grant" wrote:

I want to create a simple update flag to show when a particular
worksheet has been updated. I only want to identify when particular
cells have been updated, and have tried the following:


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim rng As Range
Set rng = Me.Range("J15:DM24")

If Not Intersect(rng, Target) Is Nothing Then
Range("C2").Value = True
End If

End Sub

The above code almost works, although it changes C2 to TRUE when any
cell in rng is selected, rather than changed. Close, but not quite
there!!

*** Sent via Developersdex http://www.developersdex.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
Worksheet_SelectionChange Gary''s Student Excel Programming 3 April 5th 06 09:46 AM
Worksheet_SelectionChange mangesh_yadav[_144_] Excel Programming 0 October 25th 04 12:56 PM
Worksheet_SelectionChange mangesh_yadav[_143_] Excel Programming 1 October 25th 04 11:49 AM
Worksheet_SelectionChange Rasmus[_2_] Excel Programming 2 June 27th 04 07:19 PM
Worksheet_SelectionChange Bill Oertell[_2_] Excel Programming 8 April 23rd 04 05:18 AM


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