Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem w/ worksheet change event | Excel Programming | |||
Change event and calculate event | Excel Programming | |||
Worksheet Change Event Problem | Excel Programming | |||
change event/after update event?? | Excel Programming |