+ Reply to Thread
Results 1 to 5 of 5

Insert a row into an excel tab from another excel tab

  1. #1
    Registered User
    Join Date
    08-02-2012
    Location
    Bellmore, New York
    MS-Off Ver
    2007
    Posts
    19

    Insert a row into an excel tab from another excel tab

    Hi,
    I have struggled with this to make it work. I did not create the excel sheet it was given to me already done.

    If this is not clear please let me know.


    the excel sheet with 2 tabs.

    one tab contains the following fields (name, dob, ID, dis, nurse, art)
    The other tab has fields ( Name, dob, Id, dis, nurse, Ven)

    they're same except one has column art and one has Ven

    I want to take the field Ven from tab 2 and insert it in tab 1 next to Art using the ID as away to match the patient.

    here is an example:

    Tab1

    Name Dob ID Dis Nurse Art
    X xxx 1x NC F 7.28
    X xxx 1x NC F 7.24
    B bb 1b C m 5.2
    c cc 1c N m 6.2
    c cc 1c N m 9

    Tab2

    Name Dob ID Dis Nurse Ven
    X xxx 1x NC F 7.30
    X xxx 1x NC F 7.01
    B bb 1b C m 8.11
    c cc 1c N m 1.2

    The final result will be:

    Name Dob ID Dis Nurse Art Ven
    X xxx 1x NC F 7.28 7.30
    X xxx 1x NC F 7.24 7.31
    B bb 1b C m 5.2 8.11
    c cc 1c N m 6.2 1.2
    c cc 1c N m 9

    Thanks in advance
    Last edited by elamranii; 08-02-2012 at 05:34 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: Insert a row into an excel tab from another excel tab

    You do not need a macro for this.

    You can use a vlookup.

    In tab 1, enter Ven in G1. Then in G2 put this formula which you can drag down to the rest of the column.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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
    Registered User
    Join Date
    08-02-2012
    Location
    Bellmore, New York
    MS-Off Ver
    2007
    Posts
    19

    Re: Insert a row into an excel tab from another excel tab

    Thanks Arlette for the quick response.
    I have never done vlookup before.
    I am not sure I follow when you said enter Ven in G1? you mean label?
    Also, the # of column is 10 and the art and ven positions are in E.

    Thanks again

  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: Insert a row into an excel tab from another excel tab

    Yes, Ven in G1 is the header.

    I didnt know that you have more columns of data. You can put the column at the end of the data and use the vlookup.

    Try researching for it in google and you will get a lot of helpful links on vlookup. Its a very commonly used function and very useful too.

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Insert a row into an excel tab from another excel tab

    Hi, have a look at the following thread I created for the July competition. It will give you some ideas of how to use vlookup. If you need a more basic explanation of vlookup, MS has a good description here, and techonthenet`s explanation is here. This was one of the first functions I truly fell in love with.

    Let me know if you have any trouble implementing it.

    Good luck.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

+ 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