+ Reply to Thread
Results 1 to 6 of 6

HALP! Macro for copying rows from several workbooks into a seperate worksheet troubles...

  1. #1
    Registered User
    Join Date
    04-18-2015
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    3

    HALP! Macro for copying rows from several workbooks into a seperate worksheet troubles...

    Hello,

    Hope you are fine.

    I need some help designing a macro that will copy specific rows from several workbooks into one worksheet. More specifically, I'm trying to import data from several staff member's Excel timesheets into a seperate spreadsheet(let's call it the "Import spreadsheet"), so as to combine the data making it easier to analyse.

    I'm sure this is doable...but my lack of VBA knowledge means it's just taking me ages to figure out :-( I am a damsel in distress!!

    So, I can save all the timesheets into one folder so the macro only has to look in one place. The macro needs to then do the following:
    - Open each timesheet in the folder of saved timesheets
    - The default entry in column B of a timesheet is the text "Code"; when logging time spent on a project, staff members need to enter a five-digit timecode reference into this column instead. If there is a five-digit timecode in any row, do the following:
    - copy the staff member's name from cell C5 of the timesheet into the next blank row of column B of the Import spreadsheet
    - copy the timecode from column B of the timesheet into into column C of the Import spreadsheet
    - copy the description from column D of the timesheet into column D of the Import spreadsheet
    - total time spent per month is summarised in columns on the timesheets (e.g. column F is the column for April's time, column G is the column for May's time). The Import spreadsheet will have the months laid out across the top in one row in a similar style. I'd like the macro to copy and paste hours spent per project, referencing the month name from the Import spreadsheet, into each month's column.
    - do this for each row in a timesheet with a five-digit number in row B
    - and do this for each timesheet saved in a folder (folder name will change on a weekly basis)

    Any help greatly appreciated...

    Thank you

    Isabel

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: HALP! Macro for copying rows from several workbooks into a seperate worksheet troubles

    The first part of your requirement is clear

    I have created two timesheets and a macro to cretae a summary,

    Place all three files into one folder

    Open Macro and it will run automatically and summarise your timesheets

    After that I need better instructions.
    Attached Files Attached Files
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    04-18-2015
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    3

    Re: HALP! Macro for copying rows from several workbooks into a seperate worksheet troubles

    Thanks so much for the prompt reply mehmetcik! Very kind of you.

    I think we're part way there. I've made an example Timesheet and an example Summary sheet to better demonstrate what I'd like the macro to be able to do.

    All timesheets are in the format of the "Timesheet.xls"; with the staff's name in one cell, and a list of codes and descriptions in seperate columns, and the total number of hours spent on each activity each month seperated by columns.
    I'd like the macro to copy and paste name, code, project description, and total hour spent per month into a row on the Summary sheet (a seperate row for each uniwue five-digit code).

    I hope this helps describe it better? Sorry, I find it quite difficult to explain this type of thing.

    Thanks again,

    Isabel
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: HALP! Macro for copying rows from several workbooks into a seperate worksheet troubles

    Put this file in the same folder as your timesheets

    You do not need a summary sheet

    Opening it will run the macro

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-18-2015
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    3

    Re: HALP! Macro for copying rows from several workbooks into a seperate worksheet troubles

    Hi,
    Thanks again.
    That made my Excel crash. And it produced an Excel sheet entitled "Summary" which is just a copy of someone's timesheet.
    Is there any way I can funnel the macro into a button instead of a file?

    Thanks
    Isabel

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: HALP! Macro for copying rows from several workbooks into a seperate worksheet troubles

    Ok I found the bug.

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. [SOLVED] Macro to seperate worksheets to seperate workbooks fired from external excel file
    By optionone in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-26-2012, 01:25 PM
  2. Replies: 1
    Last Post: 10-10-2012, 10:23 AM
  3. Need help copying duplicates to seperate worksheet
    By sdi2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2012, 05:49 PM
  4. [SOLVED] Seperate Comma seperated values in seperate rows in different tab of same worksheet
    By amlan009 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-28-2012, 04:54 AM
  5. Excel 2007 : splitting up worksheet into seperate workbooks.
    By GaidenFocus in forum Excel General
    Replies: 14
    Last Post: 11-03-2010, 01:44 PM

Tags for this Thread

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