+ Reply to Thread
Results 1 to 2 of 2

Making a "trigger"

  1. #1
    Registered User
    Join Date
    04-23-2007
    Posts
    9

    Making a "trigger"

    In column A I have a list of claim numbers, I want to make a macro that will notice when I paste a new number into that column and will automatically open the find dialog box, search for that claim number, and either take me to the row with that claim number if it exists or paste special (as text) if it doesn't. I have a macro that does the paste special as text already if that helps in making this work, it is titled pastespecial and the keyboard shortcut for it is ctrl-d. Am I dreaming or does someone know a way of doing something like this?

  2. #2
    Registered User
    Join Date
    03-08-2007
    Location
    Brisbane, Australia
    Posts
    57
    Hi HB129

    What you want is code run from an "event" and the event to use is Worksheet_Change

    1. Open your worksheet.
    2. Press ALT+F11 (this will open the VBA Coding window)
    3. In the left window, lick on the name of your Worksheet, and a code page will open on the right.
    4. on the top of the coding page are two drop-down list boxes. In the Lefthand one, that says "General", pick "Worksheet". (Just ignore the code that pops up.)
    5. In the righthand list, pick "Change"
    6. in the blank row, type in MsgBox "worksheetChanged"
    You should end up with something like:


    Please Login or Register  to view this content.
    Go back to your worksheet and enter a number. A box should pop up.

    This is the starting point. You'll need to then write code to:
    1. Test that you've changed a cell in the right column
    2. Test that you've entered a valid number
    3. Try to find the number in the list of valid numbers
    4. Copy the information if the number's found . . . .

    How are we doing?

    James

+ 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