+ Reply to Thread
Results 1 to 3 of 3

VBA Script to Combine Worksheets

  1. #1
    Registered User
    Join Date
    09-09-2018
    Location
    Missouri, USA
    MS-Off Ver
    Microsoft for Mac, Version 16.16.1, Office 365
    Posts
    37

    VBA Script to Combine Worksheets

    Hello,

    I have a workbook that will show provider information and the provider monthly ratings. Each month information is copied and pasted into this workbook. The new worksheet is given the name of the month and year in the MMM YYYY format. The information copied and pasted should be in the same column order and should always have the same columns, but that is not guaranteed.

    I want a script that will automatically combine each worksheet titled MMM YYYY (example: Apr 2019) into the "All Data" worksheet. Worksheets titled something other than MMM YYYY should not be combined. I would prefer the order of columns be the same as in the MMM YYYY worksheets. If there is a column that is added to one worksheet but is absent on the others, the script should include it in the "All Data" as well. I have no preference as to where it is added as I'm not sure this will happen, but want to be prepared in case it does. The "All Data" worksheet will include duplicate providers, but each row will be for different months rating.

    Once I have this completed, I will want the script to list the providers and their averaged rating on the 4 average worksheets (All Average, Last Quarter Average, Last 6 Month Average, and Last 12 Month Average). On these average worksheets the provider will only be listed once and include an average of the scores from the "All Data" Tab. I am hoping there is a VBA script that can read the "provnum" (in case the provider name changes) and determine the average depending on the worksheet its in. The script would need to read the last column which shows the date "FILEDATE". The "All Average" worksheet will be the average for that column on all data the entire workbook for that specific provider. The "Last Quarter Average" worksheet will be the average for that column on all data for the last completed quarter (Q1: Jan-Mar, Q2: Apr-Jun, Q3: July-Sept, Q4: Oct-Dec). The "Last 6 Month Average" will be the same concept, but for the last rolling 6 months. The "Last 12 Month Average" will be the same concept, but for the last rolling 12 months.

    In the 4 average worksheets the only information that should be included is the Provider ID (PROVNUM), Provider Name (PROVNAME), Overall Rating (OVERALL_RATING), Survey Rating (SURVEY_RATING), Quality Rating (QUALITY_RATING), Staffing Rating (STAFFING_RATING), and RN Staffing Rating (RN_STAFFING_RATING).

    I also may add a worksheet that will reflect each provider visually over a period of time by a line graph. Any suggestions on this would be appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: VBA Script to Combine Worksheets

    Hi, what you're asking is for someone to write an entire application for you, not HOW TO.
    If you search for what's possible, I'm sure you can find things that will point you in the right direction.
    Most of us here are here to help, designing and creating applications may be what some of us do for a living, but this forum is really here to help people struggling with working samples.
    Think about that, Google is still a person's best friend when it comes to looking for solutions and ideas and of course we can help when you need to tweak or edit.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA Script to Combine Worksheets

    Hi Mizzou,

    Try this:

    Please Login or Register  to view this content.
    *Allows for extra fields
    Last edited by xladept; 05-10-2019 at 11:55 AM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

+ 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. need vba script to combine sheets on top of each other.
    By mattc50940 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-02-2016, 03:37 PM
  2. Script that will combine data from different sheets
    By dLhx in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-29-2015, 12:54 PM
  3. [SOLVED] need a specific combine script
    By elmnas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-14-2015, 02:42 AM
  4. VBA Script to combine 2 separate spreadsheets into one
    By fdebelo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-16-2012, 08:02 PM
  5. VBA Script to combine 2 separate spreadsheets
    By fdebelo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-16-2012, 10:25 AM
  6. [SOLVED] Using Combine macro to combine multiple worksheets - need to modify to paste formulas
    By DLSmith in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2012, 09:07 AM
  7. optimize combine colums script
    By imatomic in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-02-2010, 04:28 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