+ Reply to Thread
Results 1 to 10 of 10

Combining two Private Sub Worksheet_Change

  1. #1
    bdf0827
    Guest

    Combining two Private Sub Worksheet_Change

    I'm having some issues here. I have two Private Sub Worksheet_Change that I need in one worksheet. I can't figure out how to make it work with both private subs. Below is my coding. Any ideas would be so helpful!!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Combining two Private Sub Worksheet_Change

    Try this:

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    bdf0827
    Guest

    Re: Combining two Private Sub Worksheet_Change

    That code didn't work for me. Let me tell you what it needs to do because the current code can be re-written probably. I'm not sure if its the most effective way or if its compatible with eachother.

    I'm going to attach the document and then explain what I'm trying to have happen.

    1) worksheet named current: when I change the status in status column to Booked - the entire row will be deleted and moved to the Booked worksheet.
    2) worksheet named current: when I change the status in the status column to DNMQ - the entire row will be deleted and moved to the DNMQ worksheet.
    3)worksheet named current: when I change the status in the status column to Application, I want todays date to appear in the App Date column (G). I don't want this date to change each time its updated or saved though. A static date if you will. Also, if I change from Approved to closing I dont want the date to change in the column G. Once its there I don't need it to change for tracking purposes.
    4) Finally, when there is a change in columns A-F I want another static date to appear in column J. This date wont change until their is any change in columns A-F.

    Any help or ideas would be so appreciated.
    Attached Files Attached Files

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Combining two Private Sub Worksheet_Change

    Hello bdf0827,

    There is and always will be one and only one Worksheet Change event per worksheet. All the code therefore must be combined into the one event module.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    bdf0827
    Guest

    Re: Combining two Private Sub Worksheet_Change

    Right...? That's what I'm trying to figure out how to do. Not disputing the fact that there can be only one change event.




    Quote Originally Posted by Leith Ross View Post
    Hello bdf0827,

    There is and always will be one and only one Worksheet Change event per worksheet. All the code therefore must be combined into the one event module.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Combining two Private Sub Worksheet_Change

    That code didn't work for me.
    That's not very helpful. Did it do nothing? Something, but not what you wanted? In what way?

    Are you looking for someone to code to your specifications (aka, a consultant), or someone to help you help yourself?

  7. #7
    bdf0827
    Guest

    Re: Combining two Private Sub Worksheet_Change

    It didn't work as in it did nothing. And I'm trying to learn this stuff. It's hard having to filter through the sarcasm everyone seems to post.


    Quote Originally Posted by shg View Post
    That's not very helpful. Did it do nothing? Something, but not what you wanted? In what way?

    Are you looking for someone to code to your specifications (aka, a consultant), or someone to help you help yourself?

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Combining two Private Sub Worksheet_Change

    Find another forum then

    You haven't even used the suggested code
    Last edited by royUK; 11-14-2011 at 03:15 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  9. #9
    bdf0827
    Guest

    Thumbs down Re: Combining two Private Sub Worksheet_Change

    Really, Roy? Can you not read? I said it didn't work. Stop trolling. Troll!

    Quote Originally Posted by royUK View Post
    Find another forum then

    You haven't even used the suggested code

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Combining two Private Sub Worksheet_Change

    It's not used in your attachment so how can we tell if you have used it correctly?

    Any way uou have the option to go

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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