+ Reply to Thread
Results 1 to 4 of 4

Event handling...

  1. #1
    Alex
    Guest

    Event handling...

    Excel Helper

    I have a list of names in column A.

    What i want is program whereby if I enter a new name at the bottom of the
    column, if it is a duplicate (i.e. name appears elsehwere in list) then a
    msgbox appears telling em it is a duplicate.

    Now I can actauly ahcieve this in VBA but...

    I have to actaully execute the macro maually.

    How can i get the macro to run automatically i.e. I enter a new name, press
    enter, and the macro runs without me clicking a separate button to run it of
    pressing F5 etc.

    I have tried...

    Application.Volatile
    Application. OnKey
    Application. Onaction

    How do I get Excel to run a macro once an event has occurred.

    Any insights appreciated...

    Alex

  2. #2
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203
    In VB Editor, double-click on the sheet you want so that you can view its code window.

    Change selection in box on upper left of code window from (General) to Worksheet.

    In the box at upper right of code window choose Selection Change.

    In the subroutine, call your macro.

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Call myMacro
    End Sub

  3. #3
    Tom Ogilvy
    Guest

    Re: Event handling...

    Use the WorkSheet Change Event

    see Chip Pearson's page on Events

    http://www.cpearson.com/excel/events.htm

    --
    Regards,
    Tom Ogilvy

    "Alex" <[email protected]> wrote in message
    news:[email protected]...
    > Excel Helper
    >
    > I have a list of names in column A.
    >
    > What i want is program whereby if I enter a new name at the bottom of the
    > column, if it is a duplicate (i.e. name appears elsehwere in list) then a
    > msgbox appears telling em it is a duplicate.
    >
    > Now I can actauly ahcieve this in VBA but...
    >
    > I have to actaully execute the macro maually.
    >
    > How can i get the macro to run automatically i.e. I enter a new name,

    press
    > enter, and the macro runs without me clicking a separate button to run it

    of
    > pressing F5 etc.
    >
    > I have tried...
    >
    > Application.Volatile
    > Application. OnKey
    > Application. Onaction
    >
    > How do I get Excel to run a macro once an event has occurred.
    >
    > Any insights appreciated...
    >
    > Alex




  4. #4
    Registered User
    Join Date
    02-28-2004
    Location
    Oregon
    Posts
    35
    An event such as this might look like this ...


    Please Login or Register  to view this content.
    .. depending on your desires. Hope this helps.
    Regards,
    Zack Barresse

+ 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