+ Reply to Thread
Results 1 to 10 of 10

Macro that copys data from one sheet to another then adds each time new data is entered

  1. #1
    Registered User
    Join Date
    07-30-2013
    Location
    NZ
    MS-Off Ver
    Excel 2007
    Posts
    15

    Macro that copys data from one sheet to another then adds each time new data is entered

    Hi all
    I have a sheet where i am entering hours worked in different areas for the month, i would like to be able to enter in hours for one person the click a button and that data will copy to another data sheet, clear the form so i can enter the next persons hours. Then once i enter the next lot of hours in press that button and it performs an addition in the other sheet adding each lot of data as i enter them. This will also be based on each month?? Help please

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: Macro that copys data from one sheet to another then adds each time new data is entere

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    07-30-2013
    Location
    NZ
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Macro that copys data from one sheet to another then adds each time new data is entere

    Here is a sample of what i need
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-30-2013
    Location
    NZ
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Macro that copys data from one sheet to another then adds each time new data is entere

    Hello any replies???

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: Macro that copys data from one sheet to another then adds each time new data is entere

    While you have included a sample spreadsheet, it is not clear where the data entered is supposed to placed. I think a more detailed explanation is in order. Please be as specific as possible with perhaps examples of what several data entries will look like. It is not clear to me and I suppose, not clear to any one else.

  6. #6
    Registered User
    Join Date
    07-30-2013
    Location
    NZ
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Macro that copys data from one sheet to another then adds each time new data is entere

    Hi There, so the "input tab", i will enter for each employee what hours they have done for the day in each area. I would like a button macro that would then copy that data to the "Data tab" in the row of the month entered in the input sheet, matching each area in the input sheet with the areas in the data sheet, every entry should be calculated in the data sheet. So if i enter for an employee in August 2013 that he done 3 hours in RnD and 3 hours in Shipping then click the button it will copy those hours over to the data sheet into the correct row and under the correct column. The input sheet should then clear and i can then enter the next employees hours in the input sheet click the button and it will then perform an addition of those hours to the existing hours in the data sheet for that month and under the correct headings. Is that clear.....

  7. #7
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Macro that copys data from one sheet to another then adds each time new data is entere

    Maybe something like:
    Please Login or Register  to view this content.
    but you will have to change your headings so they are identical on the data and input sheets (e.g. total production hours in month on input sheet and production hours in month on data sheet)
    Last edited by ragulduy; 09-09-2013 at 09:59 AM.

  8. #8
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro that copys data from one sheet to another then adds each time new data is entere

    Hi otenemel,

    I have a suggestion to make this problem a lot easier to deal with. Excel likes data in TABLES. I've created a Sheet1 in the attached with a lot of fake data. Then I did a pivot table of the data, grouping the dates by month and filtering by the employee name. If I was doing this problem this is how I would do it. See if this pivot table example gives you an idea on how to do this problem in a different way.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  9. #9
    Registered User
    Join Date
    07-30-2013
    Location
    NZ
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Macro that copys data from one sheet to another then adds each time new data is entere

    Hi There

    i am trying to run this macro and it keeps coming up with error "run-time error '1004' Unable to get the match property of the worksheetfunction class, then when i debug col_n = WorksheetFunction.Match(cl.Offset(0, -1), out_ws.Range("A1:N1"), 0) is highlighted

  10. #10
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Macro that copys data from one sheet to another then adds each time new data is entere

    I'd guess that means that your headers don't match up. As I mentinoed you need to make sure row1 and column A on the different sheets are identical. Otherwise it won't be able to match the text.

+ 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: 2
    Last Post: 06-12-2013, 07:41 AM
  2. Macro that adds row when new data is present
    By dorronsoro1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-12-2013, 05:50 PM
  3. Replies: 0
    Last Post: 12-22-2011, 03:42 PM
  4. Replies: 11
    Last Post: 07-13-2011, 05:37 PM
  5. Moving Data from One Sheet to a Log on another sheet which adds a row every day
    By dynamo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-27-2011, 03:09 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