+ Reply to Thread
Results 1 to 5 of 5

VBA to copy certain cell from certain worksheet to master worksheet

  1. #1
    Registered User
    Join Date
    05-01-2017
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    5

    VBA to copy certain cell from certain worksheet to master worksheet

    Hello again.
    I need a VBA code that can copy/combine certain cell values from certain worksheets into 1 worksheet. I have been searching the internet & found a good code that I have tried to tweak to fit my situation but have had only limited luck. My workbook is a shared workbook that is updated on a daily basis.
    What I need the code to do is copy the occupied cell content from each worksheet starting at cell C3 and paste it into the master worksheet starting in cell A3. Data is added to each sheet on a daily basis and each sheet will have a different amount of data on it (one sheet might have 27 rows of content and another 15). I don't know if there is a way to copy/paste the conditional formatting also, if not, then that is not a big deal.
    I have attached a copy of a very condensed version of the worksheet with only a small amount of data on it. I also have a tab that shows the original code that I am trying to use. I have updated the names of the worksheets in the code but I have left all the other code as it was.
    Can you please look at the code and tell me what needs to be changed to accomplish this task?

    Thanking you in advance!!
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,958

    Re: VBA to copy certain cell from certain worksheet to master worksheet

    A couple of things: you have Excel 2016 which means you have tables. This means that you don't have to have a thousand rows filled with formulas for rows with no data. One of the advantages of tables is that they copy down formulas, validations and formats automatically. So when you add data to a row immediately below the table, it becomes part of the table, and it inherits everything from the row above. You an even remove all the data from a table and it will still "remember" the formulas, formats and validations when you paste new data in.

    Here is more information on tables: http://www.utteraccess.com/wiki/Tables_in_Excel.

    Here is an assumption I will make: you will be adding data to people's sheets each day. You don't want to be copying the old data over and over again winding up with duplicate data.

    I also assume that you have more than just two people, so I'll have to give you a place to enter the list of sheets you want to copy.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,958

    Re: VBA to copy certain cell from certain worksheet to master worksheet

    Here is my shot at it using tables.

    I notice that you have several formulas that are "broken" they have broken references. I do not know what these were supposed to look up. I suggest you fix these references, then make a copy of one of the people's sheets and clear out the data. Save this sheet as a template. Then for new people. make a copy of it. You can copy and paste data into it, but you may have to re-establish the formulas. If you copy over a formula, then the cells get the new formula.

    Once established as data is added row by row, then the formulas and formats will copy down.

    I tried to preserve the conditional formatting in the copy, but since we've shifted rows, that did not work out. I suggest that you set up the conditional formatting in the table in the master sheet. As the program copies data in, the format will be applied to the whole table.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-01-2017
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    5

    Re: VBA to copy certain cell from certain worksheet to master worksheet

    Thank you, dflak, for your response. However the workbook will be a shared workbook so I cannot use a table. Believe me, I would much rather be able to use a table.
    The broken references are because I had to delete several reference sheets because they contained too much data and made the file too large to upload to this site.
    Do you have suggestions for the VBA code?
    Last edited by Yokus; 05-05-2017 at 06:08 PM.

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,958

    Re: VBA to copy certain cell from certain worksheet to master worksheet

    Shared workbooks cannot contain macros. I did not know that they could not contain Excel Tables too.

    If you want concurrent access to data, then you need a database. You can build an application in MS-Access (paid license required) and distribute it to the users (free download from Microsoft available - they can do data entry and run reports - they cannot do development). Then you can use MS-Query to pull in the data and analyze and display in Excel.

    Technologically, it's a relatively easy system to implement and offers a lot of benefits. If you can sell such a solution to your management, you will have a very powerful and flexible system.

+ 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. Macro to copy data from multiple worksheet cells in to a single Master worksheet
    By thunt13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-08-2015, 03:24 PM
  2. [SOLVED] Macro to Copy Master Worksheet create and paste in new auto named worksheet
    By TheRealLethality in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2014, 12:46 AM
  3. [SOLVED] copy the particular worksheet from closed wb,paste as individual worksheet into master vba
    By johnodys in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-02-2014, 10:25 AM
  4. Copy Master Worksheet and Rename it Using Cell Value from another Worksheet
    By iseman22 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2013, 07:49 AM
  5. [SOLVED] Copy Data from Multiple Worksheet to Master Worksheet
    By koolguys4u in forum Excel General
    Replies: 1
    Last Post: 07-02-2012, 08:14 AM
  6. Drop Down List to Copy Entire Contents of Worksheet into Master Worksheet
    By mrmartin in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-14-2011, 10:54 PM
  7. Copy an existing worksheet and carry totals to a master worksheet
    By adore_r in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2008, 12:02 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