EntireRow.Copy Issues VBA

  • [SIZE=14px]Thanks in advance for help, I am new to VBA and really appreciate it!


    I have created a workbook that I am hoping will help to organize my clinic's record requests. The plan is to be able to input information (under the "Input" sheet) and to then be able to direct the information to another sheet by making a selection in the "Provider" column (F) or the "Type of Record" Column (G).


    If "AG" is selected in column "F" in input sheet> entire row is copied to the "AG" Sheet
    If "DS" is selected in column "F" in input sheet> entire row is copied to the "DS" Sheet
    If "NL" is selected in column "F" in input sheet > entire row is copied to the "NL" Sheet
    If "EH" is selected in column "F" in input sheet> entire row is copied to the "EH" Sheet
    If "JH" is selected in column "F" in input sheet> entire row is copied to the "JH" Sheet
    If "RW" is selected in column "F" in input sheet> entire row is copied to the "RW" Sheet
    If "LS" is selected in column "F" in input sheet> entire row is copied to the "LS" Sheet
    If "SP" is selected in column "F" in input sheet> entire row is copied to the "SP" Sheet


    If "Clouded Images" is selected in column "G" in input sheet> entire row is copied to the "Rad Cloud" Sheet
    If "Faxed Record" is selected in column "G" in input sheet> entire row is copied to the "Faxed" Sheet
    [/SIZE]


    I have entered some code that does not seem to work, please let me know what I am doing wrong!

  • Hello,


    Thanks for you sample file ...


    Regarding the way you are using the Input Sheet :


    Is Column F ( Provider ) the very last column to be filled in ...?


    If it is the case, the copy process could be fully automatic ....

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • The Provider could certainly be the last column to be completed, I am open to making any changes that can make this sheet functional. How can I make this automatic?

  • Hello qqtest,


    Following on from what Carim has said, the following code may do the task for you:-



    You'll need to make entries in either Columns F or G the last entry per row.
    The code is a Worksheet_Change event so once you have made a final entry in either Columns F or G, the code will execute and transfer the relevant row of data to the relevant sheet.


    To implement the code:-


    - Right click on the "Input" sheet tab.
    - Select "View Code" from the menu that appears.
    - In the big white field that then appears, paste the above code.


    I've attached your sample file with the code implemented. I've also removed all conditional formatting from the sample just for the sake of clarity and all existing codes that you had tried to implement.


    Test the code in a copy of your workbook first.


    Carim may come up with another option for you.


    I hope that this helps.


    Cheerio,
    vcoolio.


    [ATTACH]n1209526[/ATTACH]

  • [USER="280827"]vcoolio[/USER] :congrats:


    Your solution is excellent ...!!!


    The event macro is what makes the most sense ...


    Would have added a couple of Validation Lists ...to avoid potential typing mistakes in Columns F and G ...:wink:


    Cheerio


    :smile:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Thank you Carim. What an honour for me with such praise coming from an OzMVP (and 007 at that!).


    Cheerio,
    vcoolio.


    You are welcome ...!!! :wink:


    Quite honestly ...it is only 005 ...


    but if you add all the taxes ... it ends up at 007 ... :smile:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Just wondering if qqtest is truly interested in getting the answer ... to his initial question ...:?

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • crosspost http://www.vbaexpress.com/foru…EntireRow-Copy-Issues-VBA


    Your post does not comply with our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.


    Post a link to any other forums where you have asked the same question.


    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved 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.


    Go to https://www.excelguru.ca/content.php?184 to understand why we ask you to do this.

  • I don't know Carim. Perhaps the Poster is away. Paul Hossler offered up a solution over at VBA Express also but the Poster has yet to reply to that as well.


    Anyway.....................


    Cheerio,
    vcoolio.

  • Hello,


    Your solution is ... By Far ... much much better ... than the one proposed by Paul Hossler in the other forum ... :hammerhe:


    Cheerio :wink:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • I hope that Paul does read this thread ...!!! :smile:


    :facepull:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

Participate now!

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