+ Reply to Thread
Results 1 to 10 of 10

Macro-Copy and paste the new data to the next empty row on summary sheet

  1. #1
    Registered User
    Join Date
    05-05-2014
    Location
    Hunstville. AL
    MS-Off Ver
    Excel 2010
    Posts
    6

    Macro-Copy and paste the new data to the next empty row on summary sheet

    I'm never done a macro before and of course I'm very new to excel. I have a worksheet for lessons learned that have multiple sheets for each state. I want to create a macro that every time I enter a new data into a row and hit "Add to summary sheet" and it copy and paste the the next available row in summary sheet. I"m very new to excel , so please help me with the code.

    Please see the attached file for my workbook. Thank you guys
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro-Copy and paste the new data to the next empty row on summary sheet

    From a "process" point of view, I'd think pressing buttons on each sheet to transfer data to the Summary would quickly lead to duplications and errors. I would think it would be better to have the SUMMARY sheet collect it's own data for you fresh each time you look at the Summary sheet. This way you can make edits and updates to the existing data already on each of the individual sheets, and the next time you look at the SUMMARY those updates will be there as well.

    We would create a Worksheet_Activate macro in the SUMMARY sheet module that triggers itself each time you view the sheet. It would clear it's current data, then run through all the sheets and copy the data in anew, skipping the sheets "Sheet1" and "Summary" as it copies.

    Would that work for you? No buttons!
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    05-05-2014
    Location
    Hunstville. AL
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro-Copy and paste the new data to the next empty row on summary sheet

    Sounds great. Would please help me with the code. Thank you JBeaucaire for very quick respond

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro-Copy and paste the new data to the next empty row on summary sheet

    This is the event macro in the Summary sheet module:
    Please Login or Register  to view this content.
    I also cleaned up a lot of stray garbage down below on each of your sub sheets. Make sure there isn't any of the in your real workbook or it may mess up the macro's attempt to see the last row of data on each sheet and copy down to that point only.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-05-2014
    Location
    Hunstville. AL
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro-Copy and paste the new data to the next empty row on summary sheet

    Great. Thank you so much JBeaucaire.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro-Copy and paste the new data to the next empty row on summary sheet

    I've marked this thread as SOLVED for you.
    Next time, select Thread Tools from the links above to mark a thread as SOLVED. Thanks.

  7. #7
    Registered User
    Join Date
    05-05-2014
    Location
    Hunstville. AL
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro-Copy and paste the new data to the next empty row on summary sheet

    Got it. Thanks JBeaucaire

  8. #8
    Registered User
    Join Date
    05-05-2014
    Location
    Hunstville. AL
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro-Copy and paste the new data to the next empty row on summary sheet

    JBeaucaire

    I noticed if I enter the data in order sheet1, sheet2, sheet3 then this code works, but I enter data from sheet 4 first, it would copy all the header from sheeet 1, sheet2, sheet3. I don't want to copy the header just the data (A9). Please advise

    Thank you
    Attached Files Attached Files

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro-Copy and paste the new data to the next empty row on summary sheet

    Blanks, didn't think about that. Here's a tweak:

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    05-05-2014
    Location
    Hunstville. AL
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro-Copy and paste the new data to the next empty row on summary sheet

    Yay, it works thanks again JBeaucaire. you are the best

+ 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] Copy And Paste on Another Sheet ( next time paste data from empty row )
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-17-2014, 02:29 AM
  2. [SOLVED] Macro to Copy Range and Paste in the Empty Row Same Sheet
    By kaurka in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-22-2013, 11:01 AM
  3. Copy and paste the most recent entered data from other worksheets to summary sheet
    By cvsrini in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-18-2013, 04:51 AM
  4. Replies: 1
    Last Post: 03-28-2013, 02:49 PM
  5. Copy two data sets, filter it and paste to summary sheet
    By pauldaddyadams in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-03-2012, 07:15 AM

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