+ Reply to Thread
Results 1 to 4 of 4

Event Macro to insert text in cell based on input of another cell

  1. #1
    Registered User
    Join Date
    12-16-2011
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Event Macro to insert text in cell based on input of another cell

    Hi,

    Background:
    I have a macro that is used by the end user to validate if the code they input in a form will be accepted in our system or not. They input the coding in a specific range of cells (say B20:E40) and press the macro which returns a message in the column N which says whether the code was successful or invalid. So if the coding in row 20 is invalid the macro returns a message in N20 that says invalid.

    The problem with this structure is when the coding is changed or deleted from the row, the message in column N remains the same until they re-run the macro.

    Event Macro:
    I want to create an event macro to be triggered in the event that any cell in range(B20:E40) is changed to identify that the code needs to be re-validated. I am able to create this using this simple macro:

    Please Login or Register  to view this content.
    Here's my problem and sorry it took so long to get to the point, if the code in the row is erased I want the message in column N to disappear.

    Outcome:
    So if the coding is changed in a row, column N in that row = "Validation Required", if no code in the row, column N = "". Then once the validation macro is ran column N is replaced with "success"or "invalid". From there any change or deletion of rows will results in one of the two outcomes created by the event macro.

    I hope that makes sense, let me know if you need more information.

    Thanks,

    Nick


    Note: Solved in Cross-post

    http://vbaexpress.com/forum/showthread.php?t=43561
    Last edited by nplouffe; 09-09-2012 at 12:30 PM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Event Macro to insert text in cell based on input of another cell

    Welcome to the forum.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. If you need more information on how to use them, check my signature.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Event Macro to insert text in cell based on input of another cell

    crosspost:

    http://vbaexpress.com/forum/showthread.php?t=43561



  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Event Macro to insert text in cell based on input of another cell

    Thanks snb.

    Nplouffe,

    I'm afraid your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

+ 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