+ Reply to Thread
Results 1 to 4 of 4

Change Event Problem

  1. #1
    mastermind
    Guest

    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. #2
    Ron de Bruin
    Guest

    Re: 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" <[email protected]> wrote in message news:[email protected]...
    >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. #3
    mastermind
    Guest

    Re: 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. #4
    Ron de Bruin
    Guest

    Re: 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" <[email protected]> wrote in message news:[email protected]...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1