+ Reply to Thread
Results 1 to 15 of 15

need help with copying rows of data from a table in one sheet to another worksheet

  1. #1
    Registered User
    Join Date
    02-20-2012
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    10

    need help with copying rows of data from a table in one sheet to another worksheet

    I created a payroll table with drop down lists and numerical data. I would like to extract data with a certain variable (by the jobsite column) and place the entire row of data into another excel sheet which will just be a totals page for that particular job.

    How can I do this?
    If need be i can send my table to you so you can see the layout or provide a picture.


    thank you in advance! I have been stuck on this for the past few hours.

  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: need help with copying rows of data from a table in one sheet to another workshee

    It will be good if you attach a sample workbook with some dummy data.
    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
    02-20-2012
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: need help with copying rows of data from a table in one sheet to another workshee

    Quote Originally Posted by arlu1201 View Post
    It will be good if you attach a sample workbook with some dummy data.
    Attached! thanks for the help. what i would like to do grab everyone with the job site labeled as tony's house and put them in a separate workbook labeled tony's house, and everyone with a harman job site name and send it to a file named harman.
    when i say grab them i mean their entire row within the table.

    if it is not possible to make them go to a new file i will have to settle with a new sheet in the same workbook.

    i created what the new file or sheet should look like in another sheet on that file just so you may view that as well.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-20-2012
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: need help with copying rows of data from a table in one sheet to another workshee

    Quote Originally Posted by tonyhelp View Post
    Attached! thanks for the help. what i would like to do grab everyone with the job site labeled as tony's house and put them in a separate workbook labeled tony's house, and everyone with a harman job site name and send it to a file named harman.
    when i say grab them i mean their entire row within the table.

    if it is not possible to make them go to a new file i will have to settle with a new sheet in the same workbook.

    i created what the new file or sheet should look like in another sheet on that file just so you may view that as well.
    any help anyone? I need to get this functional by wednesday the latest!

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: need help with copying rows of data from a table in one sheet to another workshee

    You can use this code -
    Please Login or Register  to view this content.
    You will observe that even though you can manually name the sheet as "Tony's house", you will get an error message while doing the same thing through VBA. This is because of the single quote in the name. If you remove it in your source data, the code will work fine.

    Also, this code copies the data to several worksheets in the same workbook. If you need it to go to a new workbook, is it one workbook per job site? Or is it one new workbook with several sheets (one for each job site)?

  6. #6
    Registered User
    Join Date
    02-20-2012
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: need help with copying rows of data from a table in one sheet to another workshee

    Quote Originally Posted by arlu1201 View Post
    You can use this code -
    Please Login or Register  to view this content.
    You will observe that even though you can manually name the sheet as "Tony's house", you will get an error message while doing the same thing through VBA. This is because of the single quote in the name. If you remove it in your source data, the code will work fine.

    Also, this code copies the data to several worksheets in the same workbook. If you need it to go to a new workbook, is it one workbook per job site? Or is it one new workbook with several sheets (one for each job site)?
    I can take out the single quote no problem. however i need it to go into a workbook per each job. One thing is the workbook per job is a constant work book that is used until the job is complete however the payroll sheet will be created every week so that i can know how much the total amount is each week.

    thank you so much for the help.
    can you link me to a tutorial on how to use the code?

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: need help with copying rows of data from a table in one sheet to another workshee

    I can take out the single quote no problem. however i need it to go into a workbook per each job. One thing is the workbook per job is a constant work book that is used until the job is complete however the payroll sheet will be created every week so that i can know how much the total amount is each week.
    What do you mean by this? Is it going to affect your data? Do you mean that you have to retain the quote?

    To use the code, press Alt+F11 on your file. This will open the code window. On the left hand side, you will see Microsoft Excel Objects. Right click on it and select Insert->Module. Then copy the code into the blank screen that will appear on your right. Go back to your excel file and choose View->Macros. Run the macro given.

  8. #8
    Registered User
    Join Date
    02-20-2012
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: need help with copying rows of data from a table in one sheet to another workshee

    Quote Originally Posted by arlu1201 View Post
    What do you mean by this? Is it going to affect your data? Do you mean that you have to retain the quote?

    To use the code, press Alt+F11 on your file. This will open the code window. On the left hand side, you will see Microsoft Excel Objects. Right click on it and select Insert->Module. Then copy the code into the blank screen that will appear on your right. Go back to your excel file and choose View->Macros. Run the macro given.
    What I meant by what I said is that every week i will create a new payroll sheet (the sample one i sent you) So that i may get the total amount for that week alone.
    However, overlooking my sheet i ran into a problem I want totals per each employee so that I know how much each employee is paid total for that particular week.

    what needs to be done to the code so that it send the line of info into a new workbook and not a new sheet?

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: need help with copying rows of data from a table in one sheet to another workshee

    Do you mean each employee's data should go into a new workbook?

  10. #10
    Registered User
    Join Date
    02-20-2012
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: need help with copying rows of data from a table in one sheet to another workshee

    OK, what I need is for my weeks total in the oringal sheet (which I have done so already), then whom ever worked at jobsite X to go to a workbook called job x or whatever name.

    What I cannot seem to figure out how to do is after that is done in the original sheet where I have all the information and the weeks total I would like to have a total for each individual employee to know how much to cut the check out for. This will be in the original sheet.

  11. #11
    Registered User
    Join Date
    02-20-2012
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: need help with copying rows of data from a table in one sheet to another worksheet

    Can anyone help me out? I am lost.

  12. #12
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: need help with copying rows of data from a table in one sheet to another worksheet

    Will look into this first thing tomorrow.

  13. #13
    Registered User
    Join Date
    02-20-2012
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: need help with copying rows of data from a table in one sheet to another worksheet

    Quote Originally Posted by arlu1201 View Post
    Will look into this first thing tomorrow.
    thanks im lost with this.

  14. #14
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: need help with copying rows of data from a table in one sheet to another worksheet

    Tony,

    I went through your entire thread again. But your request is a little confusing. To repeat what i have understood so far -

    You would like all the data pertaining to Tonys house, Harman, etc to go into 1 new workbook each.

    You also want the totals per employee per week in each of these new workbooks that have been created, right?

    If yes, we can simplify this by having the date inserted into a column when the macro was run. So if you run it once every week, each row of data in each of the workbooks will have the run date. Then we can do a normal subtotal grouping it by dates. This way, you will get the weekly subtotal in each file.

    Is this fine?

  15. #15
    Registered User
    Join Date
    02-20-2012
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: need help with copying rows of data from a table in one sheet to another worksheet

    I want the totals per each employee per week in the main workbook. (the weekly one) also the total of all employees for that week.

    besides that one point you have it spot on.

    thanks for the help!

+ 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