+ Reply to Thread
Results 1 to 5 of 5

Automatically Copy Cell Data From Multiple Sheet to a Summary Sheet

  1. #1
    Forum Contributor
    Join Date
    04-07-2020
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    219

    Automatically Copy Cell Data From Multiple Sheet to a Summary Sheet

    Hi ,

    I have a vba code below that I created to copy multiple cell values in a active sheet to a summary data sheet "Sheet4". The problem is, I cannot find the correct coding that will works should I have many other sheets (35 in total) feeding the exact same cell data to the summary sheet as well when the command button is clicked. You will notice it is referred to as "Audit Template". I have tried ActiveSheet, WorkSheet, etc.

    To further the problem, when I copy the "Audit Template" sheet to create a new sheet it says that there is already a macro " Sub Submit_AuditSheet_Data()"

    What would be the correct wording in the code to when a make a copy of the template sheet that al lthe copied sheet uses the same macro and that the command button functions in all copied sheets

    Please Login or Register  to view this content.
    Last edited by AliGW; 04-08-2020 at 01:57 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-22-2018
    Location
    Blackpool, England
    MS-Off Ver
    2019
    Posts
    408

    Re: Automatically Copy Cell Data From Multiple Sheet to a Summary Sheet

    Hi there, and welcome to the forum. One of the mods may be along shortly to point out that code should be included between CODE tags - it's easy to do by clicking the # button on the editor. Anyway...

    A couple of things:
    • You really don't need to copy the VBA code and have a separate function for each worksheet.
      Instead, if you have a command button on the "template" worksheet that you're copying, just use that to call a function that does the work for you
    • Although you can just accept the code that's generated by recording a macro, it's usually quite inefficient.
      In this particular case, VBA is selecting, using selections, reselecting... and it goes on.
      Instead, replace the blahblah.select and selection.dostuffhere with direct references
    So, here's an idea to get you started.

    Put this in a new Module (right-click Object explorer -> Insert -> Module)
    Please Login or Register  to view this content.
    (Normally I wouldn't use "ActiveSheet", but if it's only going to be run from a command button on a worksheet it'll do the trick on this occasion)

    This code should be associated with a command button on each template sheet - it just calls the function that's up there ^^^
    Please Login or Register  to view this content.
    When you copy that worksheet it'll create a worksheet with a command button on it.

    Don't forget to tweak that code to suit your ranges and worksheet names etc.

    HTH
    Tim
    Never stop learning!
    <--- please consider *-ing !

  3. #3
    Forum Contributor
    Join Date
    04-07-2020
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    219

    Re: Automatically Copy Cell Data From Multiple Sheet to a Summary Sheet

    Thank you very much. It works perfectly. Jezz - you guys are awesome. Unfortunately me being a absolute NEWBE I had to do it the hard way of recording steps cause I don't now coding at all

    But thank you it is much appreciated !!!!

  4. #4
    Valued Forum Contributor
    Join Date
    06-22-2018
    Location
    Blackpool, England
    MS-Off Ver
    2019
    Posts
    408

    Re: Automatically Copy Cell Data From Multiple Sheet to a Summary Sheet

    Glad I could be of help. Don't forget to mark the thread [SOLVED] using the thread tools at the top of the page.

    You can also show your appreiciation for those who have helped by clicking the * at the side of their posts if you wish to leave feedback.

    Tim

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Automatically Copy Cell Data From Multiple Sheet to a Summary Sheet

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new, I have done it for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. Copy data from multiple sheet and fill up summary sheet.
    By manharji in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-11-2020, 09:12 AM
  2. [SOLVED] Copy data from multiple sheet and fill up summary sheet.
    By manharji in forum Excel General
    Replies: 1
    Last Post: 03-10-2020, 08:29 PM
  3. [SOLVED] vba to copy a specific sheet from multiple workbooks to summary sheet
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-27-2019, 02:41 PM
  4. Copy & Paste Row 3 from multiple worksheets to summary sheet if cell A3 equals a date
    By Volunteer2 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-02-2015, 12:04 PM
  5. [SOLVED] copy data from multiple worksheets and paste into summary sheet
    By forquaidian in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-19-2014, 08:27 AM
  6. Copy data from multiple sheet in multiple books into a new summary workbook
    By dobba in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-13-2014, 08:14 AM
  7. [SOLVED] Summary sheet - copy cell contents from multiple sheets to one summary sheet
    By jsmity in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2013, 10:32 AM

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