Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Worksheet_SelectionChange | Excel Programming | |||
Worksheet_SelectionChange | Excel Programming | |||
Worksheet_SelectionChange | Excel Programming | |||
Worksheet_SelectionChange | Excel Programming | |||
Worksheet_SelectionChange | Excel Programming |