+ Reply to Thread
Results 1 to 13 of 13

Merge/Consolidate Multiple Timesheet data into a Single Sheet

  1. #1
    Registered User
    Join Date
    06-13-2011
    Location
    Bournemouth
    MS-Off Ver
    Excel 2010
    Posts
    19

    Merge/Consolidate Multiple Timesheet data into a Single Sheet

    Guys,

    I hope that some one can help with my current Excel dilemma. I have tried to get to grips with the programming concept of VBA with a limited amount of success and as highlighted in my previous post http://www.excelforum.com/excel-prog...html?p=2920209 think that i'm about 80% of the way there.

    What i'm trying to achieve is to consolidate 6 sheets that are time sheet templates into a single sheet every month, now i've managed to consolidate the data into a single sheet, however, i only want the macro to copy a row if a date is entered into the first column and not to copy the 851 rows part completed as a template.

    I have attached a copy of the spreadsheet and would appreciate any help to complete this.

    Thanks in anticipation.
    Attached Files Attached Files

  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: Merge/Consolidate Multiple Timesheet data into a Single Sheet

    This is the code you need -
    Please Login or Register  to view this content.
    You do not need to use functions to find the lastcol and the lastrow. I have done it in the code itself.

    Put the code in a standard module.
    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
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Merge/Consolidate Multiple Timesheet data into a Single Sheet

    Arlu,
    Your code only copies the heading, not the rest of the data. I like your simple code of consolidating sheets and keen to include on the code how to copy the names of each sheet in the master sheet in column "A". For e.g in the attached Macro by Ron, the name of each sheet is copied in the column H. How do you incorporate your code, so that it does the same as Ron's but the name of sheets should be in column "A", not "H"?

  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: Merge/Consolidate Multiple Timesheet data into a Single Sheet

    I ran the code on the sample file you provided and it works fine. Your test file didnt have any dates in column A, so i put in some and tested it. Did you put the code in a standard module?

    Updated code with sheet names in column A. Ensure that a column is inserted in column A in sheet Monthly Totals with the title as required.
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Merge/Consolidate Multiple Timesheet data into a Single Sheet

    Arlu,
    I was not the one who asked the question, but have commented on it. I have now incorporated your code in to my spreadsheet and correctly pasted the names of each sheet in each row, so I have got the solution I have been looking for and now know how to include names on column A.

    Thanks for your help and will pass the button on to digbat

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

    Re: Merge/Consolidate Multiple Timesheet data into a Single Sheet

    Sorry AB33, i didnt see the name of the user.

    Ideally, you shouldnt hijack another's thread. But now i am too late.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Merge/Consolidate Multiple Timesheet data into a Single Sheet

    Arlu!
    I have seen most of your codes on consolidation and like them for thier simplcity. Instead of posting another question for just one i,e getting the names of sheet in the master sheet, It would be easy for you just to include it with this thread. I was not posting a different question on another thread. If you look at my request, it just says to include on the code, not to ask a different question. Sorry! If you took it wrongly.

  8. #8
    Registered User
    Join Date
    06-13-2011
    Location
    Bournemouth
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Merge/Consolidate Multiple Timesheet data into a Single Sheet

    Arlu,

    Many thanks for your help, was going to ask you about the sheet names appearing in each row but you beat me to it, going to tweak it slightly to sort data by operator and then date, but should be able to manage those changes.

    Thanks again.

    Dingbat

  9. #9
    Registered User
    Join Date
    06-13-2011
    Location
    Bournemouth
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Merge/Consolidate Multiple Timesheet data into a Single Sheet

    Arlu,

    Just when i thought it was sorted... I have come across an issue now as i've protected all the worksheets to prevent user access and the macro won't run. Just need to protect all sheets/workbook with same password and assume unprotect whilst macro is running? I hope this is an easy fix.

    Thanks in anticipation.

    Dingbat.

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

    Re: Merge/Consolidate Multiple Timesheet data into a Single Sheet

    You can have the macro unprotect the sheets for you, run the code and then protect them again.

    You can record these unprotect & protect actions and then add it to your code.

    If you face any issues, let me know.

  11. #11
    Registered User
    Join Date
    06-13-2011
    Location
    Bournemouth
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Merge/Consolidate Multiple Timesheet data into a Single Sheet

    Arlu,

    As pointers on the code i should used as i did the usual googling and entered various suggestions which did not work, ideally would like to run macro which automatically unprotects and then protects for me.

    Thanks

    Dingbat.

  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: Merge/Consolidate Multiple Timesheet data into a Single Sheet

    Updated code -
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    06-13-2011
    Location
    Bournemouth
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Merge/Consolidate Multiple Timesheet data into a Single Sheet

    Arlu,

    Thanks again, you've been a great help in solving my VBA issue, and i've learnt a lot about VBA in the process.

    Dingbat.

+ 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