+ Reply to Thread
Results 1 to 12 of 12

VBA Code to consolidate same column headings from certain tabs

  1. #1
    Registered User
    Join Date
    02-12-2015
    Location
    Chicago, IL
    MS-Off Ver
    N/A
    Posts
    7

    Question VBA Code to consolidate same column headings from certain tabs

    Hi,

    I've never used VBA and have been trying to figure out how to write the code I need for a few hours now.... so I'm really hoping someone is able to help

    I have an excel workbook with several different tabs. I want to create a summary sheet with certain column headers. These column headers are already on the majority of the other tabs (all except my other summary tab) and I want a macro that will pull anything under those columns on those tabs without the column headers. I also want it to stop once pulling from each tab once it goes blank.

    So far, I have the summary sheet labeled "Sales Pipeline" and I have the 4 columns that I want filled in across the top (A1-D1). I want the macro to search each tab for these column headings and then copy over any data beneath them. On each of the tabs that have these columns, the headers are in cells I5:L5. Does this make sense? Can someone please help??

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: VBA Code to consolidate same column headings from certain tabs

    it would really help us if you could attached your workbook toy our thread. This way, we can come up with a solution that you are certain it works for your workbook structure.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    02-12-2015
    Location
    Chicago, IL
    MS-Off Ver
    N/A
    Posts
    7

    Re: VBA Code to consolidate same column headings from certain tabs

    Yes, of course - silly me. Thanks for helping!! You have no idea how many times I've tried this.
    Attached Files Attached Files

  4. #4
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: VBA Code to consolidate same column headings from certain tabs

    I suppose that in column A "Submitted by" you want the employee name in cell D1 of each tab, right?
    Also as there is no data in any of your tabs in columns with headers "Sales Pursuits", "Estimated close" and "Status". Can I put anything there and the macro will copy every thing into the summary?
    I suppose the employee name will be repeated for each rows added, right?

  5. #5
    Registered User
    Join Date
    02-12-2015
    Location
    Chicago, IL
    MS-Off Ver
    N/A
    Posts
    7

    Re: VBA Code to consolidate same column headings from certain tabs

    Yes, that would be great if it could pull in the employee name from the name in cell D1. Yes, please feel free to put data in! The difficulty is that sometimes there will be data filled in in those columns and sometimes there won't (sometimes there will be multiple sales pursuits filled in and others may have zero). So I want to build the macro saying if there's no data to pull into the summary tab to go to the next worksheet with those column headers.

  6. #6
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: VBA Code to consolidate same column headings from certain tabs

    Will those headers always be in columns J, K and L for every tabs.
    Also, would it be possible to make sure there is an empty row or column all around that table J5:L52?
    This means, your have to move the "List all" to row 3 instead of row 4 as actually. If not, we can make it work anyway.

  7. #7
    Registered User
    Join Date
    02-12-2015
    Location
    Chicago, IL
    MS-Off Ver
    N/A
    Posts
    7

    Re: VBA Code to consolidate same column headings from certain tabs

    No not for all tabs which is part of the difficulty I was having. There are a few hidden tabs that I can move to the front of the spreadsheet so then it can look up the sheets after the "sales pipeline summary" tab if that's easier to do?

  8. #8
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: VBA Code to consolidate same column headings from certain tabs

    Please try this workbook and tell me how it works for you.
    The macro looks only at sheets that are visible. That was an easy fix for the moment but if you want other sheets to be visible but not to be summarized, we'll work something else.
    The macro is named "Sum_mary".
    The only draw back I see so far is that it may copy the same information more than once. Each time the macro is run, everything is transfered. There is no flag saying it was transfered before. That might be something you want to think about. Or it has to do with how you work with this workbook that I don't know of and it is not a problem for you.
    Please, get back with your comments.
    Regards
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-12-2015
    Location
    Chicago, IL
    MS-Off Ver
    N/A
    Posts
    7

    Re: VBA Code to consolidate same column headings from certain tabs

    Thanks so much! It will be refreshed weekly and will need to update with new results (and not repeat items that are already there). Would I have to try to write code to create a new spreadsheet and delete the previous one out in order to do that? I might be able to figure that out but the person who will be refreshing this every week won't know how to do it unless it automatically updates or there's a button to press. Can it just automatically update every time the worksheet is opened? Will there be any issues if it's stored on a sharepoint site?

  10. #10
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: VBA Code to consolidate same column headings from certain tabs

    It should not be a problem for the workbook to be on a sharepoint site, but you'll have to test it.
    I'm not sure to understand you about refreshing and/or update. Can you be a bit more specific please?
    We can program a button to erase old data automatically. We'll need to know what to erase though. Is that what was bothering you?
    It will be refreshed weekly and will need to update with new results (and not repeat items that are already there)
    Does this mean you need a way to tag transfered items so they won't duplicate?

  11. #11
    Registered User
    Join Date
    02-12-2015
    Location
    Chicago, IL
    MS-Off Ver
    N/A
    Posts
    7

    Re: VBA Code to consolidate same column headings from certain tabs

    Sorry if I'm not being clear - I'm not good with the lingo yet and how this all works. thanks again for your help.

    So what is going to happen with the workbook is each tab is going to be updated by a different employee each week for their current sales pursuits. Then once a week, the leader of the group has requested to see a summary of what's on the tabs (rather than flipping through all of them). So if there are changes to the data within the relevant columns on the individual worksheets, I would need it to automatically update for those changes. I think if it erased the old data and updated with whatever would be currently listed on each tab, that would work. Does that make sense/?

  12. #12
    Registered User
    Join Date
    02-12-2015
    Location
    Chicago, IL
    MS-Off Ver
    N/A
    Posts
    7

    Re: VBA Code to consolidate same column headings from certain tabs

    Hi, I made a change to the code so that it will create a new worksheet with updated data every time it is run. I can't figure out how to make the macro run though each time data is updated/changed/inputted in each of the worksheets. Can someone help with this?
    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. Consolidate data from multiple files in a directory by matching column headings
    By ezra_kirivann in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-21-2014, 11:46 AM
  2. Replies: 1
    Last Post: 01-03-2013, 01:30 AM
  3. consolidate 75 workbooks - identical headings
    By lray in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 11-10-2011, 05:53 PM
  4. VB Code to Consolidate data from different files / tabs
    By tt388 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-29-2011, 11:53 AM
  5. [SOLVED] Modifying code to Consolidate only 1 column..
    By Darin Kramer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2006, 11:50 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