+ Reply to Thread
Results 1 to 5 of 5

Copy the whole row into their perspective company

  1. #1
    Registered User
    Join Date
    06-26-2013
    Location
    El Paso, TX
    MS-Off Ver
    Excel 2007
    Posts
    2

    Copy the whole row into their perspective company

    attached is a workbook that I am working on. The first tab is the master tracker, and then the subsequent tabs are the four different companies that we have. What I'm trying to do, is make it so that when you put data into the table for a certain person, it'll automatically copy that row to the perspective tab. so in the attachment, when I enter in PFC John Smith's info it'll autmoatically copy that whole row into the HHC tab, when I put CPT John Wayne's info in, it'll automatically add the data to the C-Co tab, and keep the information on the master tracker.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    03-12-2013
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2007
    Posts
    230

    Re: Copy the whole row into their perspective company

    [code]
    Dim CompanyName As String
    Range("E2").Select
    Do Until ActiveCell.Value = ""
    CompanyName = ActiveCell.Value
    ActiveCell.EntireRow.Select
    Selection.Copy
    Sheets(CompanyName).Select
    Range("A1").Select
    Do Until ActiveCell.Value = ""
    ActiveCell.Offset(1,0).Select
    Loop
    ActiveSheet.Paste
    Sheets("LEAVE CALCULATOR MASTER").Select
    ActiveCell.Offset(1,4).Select
    Loop
    [code/]

  3. #3
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Copy the whole row into their perspective company

    you may like to try this macro and see if it works for you
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-26-2013
    Location
    El Paso, TX
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Copy the whole row into their perspective company

    this didn't work, all it did was add another tab, with the header row highlighted, and i had to run the macro, I am trying to make it automatic

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Copy the whole row into their perspective company

    Hi bri7697

    Welcome to the Forum!

    In order for this to be "truly"
    automatic
    the Code needs to be triggered by an "Event". Now, ideally, that "trigger" would be when you've completed filling out the Record. One way to do that is you make a "positive" selection to process the record. This would be my preferred approach and will allow you to have a Name/Control Number appear more than once in Sheet LEAVE CALCULATOR MASTER and in the Company Sheets.

    However, if a Name/Control Number will NEVER appear more than once in Sheet LEAVE CALCULATOR MASTER or Company Sheets, a way to make it "truly" automatic would be to base it off the "Control Number"...so, questions for you:
    • I assume you've not added "Control Number" for privacy purposes...is there a unique "Control Number" for each Name?
    • Will that "Control Number" EVER appear more than once in Sheet LEAVE CALCULATOR MASTER or in the Company Sheets?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 07-24-2013, 01:36 AM
  2. [SOLVED] Macro for copy all info related to one company paste to its own new tab
    By rochakmehta90 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-13-2013, 04:46 PM
  3. [SOLVED] Macro to copy 3 adjacent columns at a time to a separate worksheet & sort by Company name
    By anya1 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-20-2013, 06:50 AM
  4. am i able to copy data from one sheet onto another based on a company hierachy!
    By obeo2k2 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-08-2012, 11:21 AM
  5. Search on company name to auto input company address
    By jamie.c in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-12-2009, 12:38 PM

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