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

I am trying to write a change event that works on a particular range
and ONLY fires when the initial cell value is NOT " ". I have managed,
through trial and error, to write an event that will work over a range,
but cannot seem to get it to fire when I want to. It either fires all
of the time or not at all. Any help would be greatly appreciated

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Change Event Problem

Try this for A1:A10

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("A1:A10"), Target) Is Nothing Then
If Target.Value = "NOT" Then
MsgBox "YourCode or YourMacroName"
End If
End If
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"mastermind" wrote in message oups.com...
I am trying to write a change event that works on a particular range
and ONLY fires when the initial cell value is NOT " ". I have managed,
through trial and error, to write an event that will work over a range,
but cannot seem to get it to fire when I want to. It either fires all
of the time or not at all. Any help would be greatly appreciated



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Change Event Problem

That isn't quite what I was looking for. I need the macro to fire
every time except when the initial value of the cell is " " (nothing).
When the user opens the sheet for the first time it will be blank.
They will then populate certain fields with data. I don't want the
macro to fire while they are inputing the information...only if they
decide to go back and change something they have already answered. I
hope that is clearer. I don't know how else to explain it.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Change Event Problem

Try this

Public Emp As Boolean

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("A1:A10"), Target) Is Nothing Then
If Emp < True Then
MsgBox "YourCode or YourMacroName"
End If
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Emp = False
If Not Application.Intersect(Range("A1:A10"), Target) Is Nothing Then
If Target.Value = "" Then Emp = True
End If
End Sub




--
Regards Ron de Bruin
http://www.rondebruin.nl


"mastermind" wrote in message oups.com...
That isn't quite what I was looking for. I need the macro to fire
every time except when the initial value of the cell is " " (nothing).
When the user opens the sheet for the first time it will be blank.
They will then populate certain fields with data. I don't want the
macro to fire while they are inputing the information...only if they
decide to go back and change something they have already answered. I
hope that is clearer. I don't know how else to explain it.



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
Problem w/ worksheet change event Steph[_6_] Excel Programming 4 October 19th 05 06:41 PM
Change event and calculate event Antje Excel Programming 1 March 29th 05 09:03 PM
Worksheet Change Event Problem tim Excel Programming 9 March 28th 05 08:37 AM
change event/after update event?? scrabtree23[_2_] Excel Programming 1 October 20th 03 07:09 PM


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