Trying to Merge two worksheet_change(ByVal Target as Range)

  • Hello Everyone. I was tasked to create a spreadsheet that can update ranges to a new worksheet when column E (or 5) is updated to "Denied" or "Scheduled"

    When denied it will go to sheet2 and when it is schedule it will go to sheet3


    I was successful in getting "Denied" to work and move the range over successfully, but when writing the code based of the "Denied" code I learned that you have to merge the code as there cannot be two worksheet changes.


    This is the code I have so far just need tips or instructions on how to merge the code.

    Edited once, last by royUK ().

  • Welcome to the Forum. Please read the Forum Rules to understand how the Forum works and why I have added Code Tags to your post


    All VBA code posted in the forum must be wrapped in code tags, which you omitted, including single-line code snippets.Be sure to use them in future posts.


    How to use code tags


    Just highlight all of the code and press the <> in the post menu above button to add the code tags.


    Thanks.

  • Perhaps you want this


    I'm not sure exactly what your code is supposed to be doing, but it can probably be improved if you explain what you are doing.

  • The desire is to have the ability to update the status column and all of the information in that row is moved to a new sheet and deleted from the original sheet. There might be a much easier way than the code I initially started as I am definitely new at this.

  • That might be the best case scenario. Thank you so much royUK. Just as a learning thing do you know the general rules for merging two spreadsheet changes? I appreciate your help!


    Definitely sounds like I was just trying to over complicate and make it "flashy"

  • Your code will slow down inputting to the sheet because every change will force Excel to check the sheet.


    If you really need to split the data (which is a very bad idea) then don't use an event code but run code to make the split after you have finished inputting.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!