LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default worksheet change event only if cell was blank

This should do what you want. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
Dim OldValue As Variant
Dim NewValue As Variant
If Target.Count 1 Then Exit Sub
NewValue = Target.Value
Application.EnableEvents = False
Application.Undo
OldValue = Target.Value
Target.Value = NewValue
Application.EnableEvents = True
If OldValue = "" Then
'Do your thing here
End If
End Sub
"Sliman" wrote in message
...
How can you limit change event to run only if changed cell was blank.





 
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
Calculation of cell value with worksheet change event Raj[_2_] Excel Programming 2 May 30th 08 05:20 PM
change event on specific cell rather than worksheet frendabrenda1 Excel Discussion (Misc queries) 10 September 21st 06 03:37 AM
Cell value change to trigger macro (worksheet change event?) Neil Goldwasser Excel Programming 4 January 10th 06 01:55 PM
Change Cell from Validated List Not Firing Worksheet Change Event [email protected] Excel Programming 3 October 4th 04 03:00 AM


All times are GMT +1. The time now is 04:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"