+ Reply to Thread
Results 1 to 14 of 14

Displaying specific information from one sheet on another

  1. #1
    Registered User
    Join Date
    09-16-2011
    Location
    Lancaster, UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    41

    Displaying specific information from one sheet on another

    Hi again

    We archive lines from our absence report to a single sheet. The sheet with the archive on is massive and getting bigger. But that is beside the point.

    I would like to be able to have a second sheet comb through the archive and display all absences between 2 dates (All between Sunday and Saturday) which would include new absences starting, existing absences returning, and all absences that span both dates. Is would need to display the whole line of information (which is around 40 cols I think)

    Can anyone help with this?
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Displaying specific information from one sheet on another

    Hello CharlieBeth,

    Try the following code assigned to a button:-
    Please Login or Register  to view this content.
    I've assumed that the two dates are sourced from ColumnP.

    I hope that this helps.

    Cheerio,
    vcoolio.
    Last edited by vcoolio; 03-22-2018 at 08:24 AM. Reason: Typo

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Displaying specific information from one sheet on another

    or this formula that assumes that returns all rows where the start date is in P column and end date in Z column:
    Array formula:
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,176

    Re: Displaying specific information from one sheet on another

    try this,
    run the macro :StartBox
    this load a form to enter start and end dates.

    the code then cans the list and marks the records (in AQ)
    you can then filter on this.
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Displaying specific information from one sheet on another

    Hello again CharlieBeth,

    If indeed Paul is correct in saying that the End Dates are in Column Z, then my code amended as follows should work for you:-


    Please Login or Register  to view this content.
    I've attached your sample with the above code implemented. Click on the green button to see it work.

    Cheerio,
    vcoolio.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    09-16-2011
    Location
    Lancaster, UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    41

    Re: Displaying specific information from one sheet on another

    This is great - I have never touched Macros before and don't know anything about them. It is displaying the people who have returned with ease.

    Could this be tweaked to include absences that have not yet returned? Their cell in Z is empty.

    Quote Originally Posted by vcoolio View Post
    Hello again CharlieBeth,

    If indeed Paul is correct in saying that the End Dates are in Column Z, then my code amended as follows should work for you:-


    Please Login or Register  to view this content.
    I've attached your sample with the above code implemented. Click on the green button to see it work.

    Cheerio,
    vcoolio.

  7. #7
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Displaying specific information from one sheet on another

    Hello CharlieBeth,

    Could this be tweaked to include absences that have not yet returned? Their cell in Z is empty.
    Perhaps this:-
    Please Login or Register  to view this content.
    Cheerio,
    vcoolio,
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-16-2011
    Location
    Lancaster, UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    41

    Re: Displaying specific information from one sheet on another

    Hi

    Thanks for all your help so far. I think I almost have what I need now.

    I have used that CharleBeth.xlsm in this spreadsheet, but not all the absences I am looking for pull through. I'm not sure what I am doing wrong.

    I am attaching the spreadsheet I am working on. Tab 1 (All Absences) is all my absences this year. Tab 2 (This Week) is the absences between two dates - thank you for the macro - and tab 3 (Absence Table) is the information downloaded from our Kronos System that I need to marry my tab 2 info with. Currently in Tab 3 I have 12 people Kronos recorded as absent between my two dates which Tab 2 hasn't pulled off Tab 1.

    The missing people are there on Tab 1. I cannot see why it's not working for them. Have I botched it?
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Displaying specific information from one sheet on another

    Hello CharlieBeth,

    Try implementing the following code into your file in your last post:-

    Please Login or Register  to view this content.
    Some of the people (from the "Absence Table" sheet) listed in the "All Absence" sheet won't have their data transferred to the "This Week" sheet as their dates are outside the search parameters in B2 and C2.

    Cheerio,
    vcoolio.

  10. #10
    Registered User
    Join Date
    09-16-2011
    Location
    Lancaster, UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    41

    Re: Displaying specific information from one sheet on another

    That's a shame because I need all the people who have had any absence between those dates to transfer including long term sick whose absence start and return dates are well out those dates.

    Perhaps we could go at it from another angle?

    I have been given a sheet that my colleague uses. That is the one I need to combine with mine.

    "wk 34" sheet contains downloads from our T&A system. The one consistent bit of data being the Emp No for each person. The first tab is all our weekly staff. The second tab is a record of absences in the specific week (or any other time period) we are looking at. The third tab is a pivot table my colleague makes showing the number of days each absent employee has taken off work.

    "Dashboard" is the information I gather. The same Emp No is used here (which is why we used it for index, vlookup etc). It collects information of where people work - Line and Shift, their length of service and age, and reason for absence.

    What we want to be able to do is pull the Line, Shift, Reason for Absence, LOS and Age from the dashboard and display it on the 3rd tab of "wk 34" against the correct person (using the Emp No).

    I need to be able to show - for any period of time from a pay week to a financial year if that amount of data is provided on the import - the number of days lost for any particular absence reason, see if there are trends e.g. increased musclioskelial (I can't spell that!) in people with longer lengths of service etc. I have been asked for it to be displayed on the Tab 3 of "Wk 34"


    Possible??
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Displaying specific information from one sheet on another

    Hello CharlieBeth,

    That's a shame because I need all the people who have had any absence between those dates to transfer including long term sick whose absence start and return dates are well out those dates.
    If we go back to post #6, the code amended as follows should do this for you:-


    Please Login or Register  to view this content.
    I hope that this helps.

    Cheerio,
    vcoolio.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    09-16-2011
    Location
    Lancaster, UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    41

    Re: Displaying specific information from one sheet on another

    It still does not seem to find everyone, such as Emp No 210611 whose absence ran from 03/07/2017 to 22/03/2018

  13. #13
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Displaying specific information from one sheet on another

    Hello CharlieBeth,

    It still does not seem to find everyone, such as Emp No 210611 whose absence ran from 03/07/2017 to 22/03/2018
    As you are setting two date parameters to work within, the code will only work within these two date parameters. Your above quoted example was never going to show up because you have set the date parameters in the sample file as being 18/03/2018 (start) to 24/03/2018 (end). The additional "tweaks" in the last code I supplied almost got us there but there is no point in setting parameters if you intend to work outside those parameters. If you look closely at the All Absences sheet, you will see that some start dates(Column P) are greater than the end dates (Column Z) so this just confuses the issue further. One example is row 58: the start date is noted as 10/01/2018 and the end date is 12/01/2017!!

    For your particular situation, I would suggest that you use an "aging" method. By this, for example, I mean absences up to seven days, then between seven and fourteen days, then between fourteen and thirty days and then greater than thirty days. These could be colour coded in the All Absences sheet and then the relevant rows of data can be transferred to the This Week sheet based on colour for any analysis that you may have to do for the various time periods.

    I have attached your sample file again with this type of method implemented.

    Firstly, I have inserted a column in both worksheets(AA).

    Secondly, the following code is placed in the ThisWorkBook module:-


    Please Login or Register  to view this content.
    This code will insert a formula in each cell in Column AA which will, in turn, give us the number of days between the start and end dates. The code will then colour the cells in Column AA with colours that represent the different time periods: up to seven days, a pale blue colour. Up to fourteen days, green. Up to thirty days, cyan. Greater than thirty days, yellow. Cells in Column Z without values will leave the adjacent cells in Column AA white (these are the absentees yet to return).

    In some white cells you will see a #NUM! reference message. This will appear because of the problem I mentioned above about some start dates (Column P) being greater than the end dates (Column Z). You may want to address this in your actual workbook. The formula simply will not calculate the reverse order seeing that it is incorrect.

    Thirdly, the following codes are placed in one standard module:-
    Please Login or Register  to view this content.
    These codes are assigned to the buttons (in similar colours to the coloured cells in the All Absences sheet, Column AA) in the This Week sheet.
    You'll note that the codes are very similar but just reference the different colours. Click on any button in the sample file to have the relevant data transferred to the This Week sheet. I've named the buttons to refer to the different time periods.

    I hope that this helps.

    Cheerio,
    vcoolio.
    Attached Files Attached Files
    Last edited by vcoolio; 03-31-2018 at 11:12 AM. Reason: Typos

  14. #14
    Registered User
    Join Date
    09-16-2011
    Location
    Lancaster, UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    41

    Re: Displaying specific information from one sheet on another

    Thank you for all your help :-)

+ 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. Replies: 2
    Last Post: 12-04-2017, 02:41 AM
  2. Gathering sheet names and displaying them in a specific sheet column
    By LePig in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-01-2016, 09:25 AM
  3. Replies: 0
    Last Post: 01-09-2014, 02:47 PM
  4. [SOLVED] Search for Identifier in Column (different sheet) and Displaying Results in Specific Cells
    By Velocir in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2013, 11:37 AM
  5. Replies: 18
    Last Post: 04-26-2012, 10:38 AM
  6. Grabbing specific information from another sheet
    By gregbennett81 in forum Excel General
    Replies: 7
    Last Post: 08-24-2011, 07:48 PM
  7. Replies: 0
    Last Post: 05-15-2006, 09:55 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