+ Reply to Thread
Results 1 to 16 of 16

VBA for filtering data between sheets

  1. #1
    Forum Contributor
    Join Date
    05-11-2020
    Location
    Kansas City
    MS-Off Ver
    Office 365
    Posts
    162

    VBA for filtering data between sheets

    Need:
    1. Update tabs based on current shift.
    a. Ex. PROD A-1 & PROD A-2 employees and data will copy over to PROD A tab.
    i. I would like to separate the A-1 and A-2 employees and have a total line for each subshift.
    b. I am wanting to duplicate this process for each shift and subshift.
    c. My biggest need and also what may be making this more difficult is that I need the sub tabs (PROD A, PROD B, etc) to update from FT ACTIVE ROSTER and would also like to update FT ACTIVE ROSTER from data gathered in the PROD A,
    PROD B, etc tabs)
    d. I will not include status “INACTIVE” employees into the shift folders
    ROSTER SETUP.png

    2. I would also like to use the “RED SCREEN DATA” tab to automatically pull data for employees that have a “YES’ under the “RED SCREEN” column F on the ACTIVE ROSTER. I am also hoping to have the data update from either tab on this as well. The Notes are often updated and I would like that to be viewed from either the ACTIVE ROSTER or the CURRENT SHIFT TABS. I will often change the employees STATUS during meetings and that it would help a lot if the employee and there data would move to their new assignment when that happens.

    RED SCREEN.png
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: VBA for filtering data between sheets

    Do you want the current shift tabs to have the headers in the sample spreadsheet or the headers in the pictures? I used the sample spreadsheet values for now. On your point 1d, will the TERM and WORK COMP rows be added to the shift tabs or also ignored. In this iteration they are ignored?

    I have completed the initial effort. I had to add underscores to the sheet names that are not current shift tabs and rename some of the other tabs by removing the "st" in "1st" tab and "nd" in "2nd" and so on, to simplify the code. Any new sheets that are not current shift tabs should have an underscore. In the attached solution, I also added a value of 1 on the last column(J) of the current shift tabs to differentiate when a new line is added. I hid the value for now.
    Go ahead and test this functionality. The workflow requires that one select the update button on the current shift tabs, then the information will flow to the Active_Roster tab.
    The process is initiated by selecting the Update button on the Active_Roster tab.
    Please let us know if we are on the right track and if you have any questions.

    Currently only additions to the shift tabs are being updated. I am working on another iteration that will support changes to existing rows.
    Attached Files Attached Files
    Last edited by maniacb; 11-28-2020 at 04:53 AM. Reason: Status update

  3. #3
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: VBA for filtering data between sheets

    This iteration includes the following three sets of code:

    This first code is executed for the active_roster tab and populates all the shift tabs. I expect that after any changes are executed on any tab, that the update button be pressed to record those changes. To disperse the changes to all the shift and red tabs, the active_roster update should then be depressed.

    Please Login or Register  to view this content.
    This code is in each of the 12 shift sheet modules and updates a row when there is a change in that row with the number 2:

    Please Login or Register  to view this content.
    This third code is in the main module and is duplicated for each of the 12 shift tabs. It looks for the value 2 and if it finds it then either adds the row or updates changes to the row over into the active_roster tab.

    Please Login or Register  to view this content.
    Let us know if you have any questions.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    05-11-2020
    Location
    Kansas City
    MS-Off Ver
    Office 365
    Posts
    162

    Re: VBA for filtering data between sheets

    Thank you,

    That works perfectly. Is there a way to modify the border of the areas that data is in, just to black outline each sheets data? I was also wondering if there is a way to move any employee listed as a new hire to the hired_on sheet and place them under the correct team name. There could be multiple people hired on the same shift group, so it would need to expand rows if that happened.

    again, thank you so much for this.


    Adam
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: VBA for filtering data between sheets

    Added this code to be called by the active_roster button to update the Hired sheet. Let us know how it works.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    05-11-2020
    Location
    Kansas City
    MS-Off Ver
    Office 365
    Posts
    162

    Re: VBA for filtering data between sheets

    maniacb you have helped me so much with this. This is exactly what I was hoping it would do. I have a few other small things that I would like to do, but I am new to this work location and want to make sure that I get it right.

    Thank you!

    Adam

  7. #7
    Forum Contributor
    Join Date
    05-11-2020
    Location
    Kansas City
    MS-Off Ver
    Office 365
    Posts
    162

    Re: VBA for filtering data between sheets

    Updated Employees, just a couple fixes.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: VBA for filtering data between sheets

    I updated the shift tab code and renamed headers in the Hire On tab. try it now

    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: VBA for filtering data between sheets

    fixed error where more than one name addition to shift tabs were not populating correctly

    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    05-11-2020
    Location
    Kansas City
    MS-Off Ver
    Office 365
    Posts
    162

    Re: VBA for filtering data between sheets

    Everything is working very good! Thank you. I did mess up and left 3-B PROD and 3-B LOG off the Hired_On tab. They were blacked out on the original spreadsheet that I sent.

    I was also wondering about the possibility of adding a new column to the ACTIVE_ROSTER between STATUS and Notes? I forgot to add "Need to Replace" If that could also be added to all the PROD and LOG tabs so that the info could be updated back and forth that would be awesome.


    Thank you so much!


    Adam
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: VBA for filtering data between sheets

    Give this change update a try. Column added and code updated
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    05-11-2020
    Location
    Kansas City
    MS-Off Ver
    Office 365
    Posts
    162

    Re: VBA for filtering data between sheets

    Good Morning maniacb,

    I noticed that when I am updating from the Red Screen tab that I am getting a VBA error. I tried to update John Ousley's note section via the Red Screen tab and that is when I got the error. It is looking good other than that so far.

    Thank you,

    Adam Newton
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    05-11-2020
    Location
    Kansas City
    MS-Off Ver
    Office 365
    Posts
    162

    Re: VBA for filtering data between sheets

    I was also wondering if there is a way to make the notes section automatically "wrap text" so that the notes will all show up on all the tabs.

    Thanks again,

    Adam Newton

  14. #14
    Forum Contributor
    Join Date
    05-11-2020
    Location
    Kansas City
    MS-Off Ver
    Office 365
    Posts
    162

    Re: VBA for filtering data between sheets

    I am getting a VB error when updating from the ACTIVE_ROSTER tab.

    Thanks in advance,

    Adam
    Attached Files Attached Files

  15. #15
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: VBA for filtering data between sheets

    There was a sheet added without an underscore in the name. Delete sheet1 or rename the sheet with an underscore. See post number 2

  16. #16
    Forum Contributor
    Join Date
    05-11-2020
    Location
    Kansas City
    MS-Off Ver
    Office 365
    Posts
    162

    Re: VBA for filtering data between sheets

    Thank you. I couldn't figure out what happened there.

+ 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] Filtering data between sheets
    By josekr80 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2020, 05:12 AM
  2. Requesting help with filtering data in linked sheets?
    By Elijah in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-15-2018, 04:39 PM
  3. Need help - filtering data into seprate Sheets.
    By jagger2k in forum Excel General
    Replies: 3
    Last Post: 08-20-2015, 03:00 PM
  4. Filtering Data from multiple sheets
    By shkhaslam in forum Excel General
    Replies: 6
    Last Post: 06-20-2015, 11:54 AM
  5. Non-Standard Filtering of Data Between Two Excel Sheets
    By tadams79 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2014, 09:55 AM
  6. Filtering multiple sheets of data
    By stvbrown2184 in forum Excel General
    Replies: 6
    Last Post: 07-25-2013, 12:22 PM
  7. Filtering data, moving to new sheets
    By randell.graybill in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2010, 07:07 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