+ Reply to Thread
Results 1 to 4 of 4

macro code for summing of leave for employees

  1. #1
    Forum Contributor
    Join Date
    10-31-2013
    Location
    india
    MS-Off Ver
    Excel 2019
    Posts
    147

    macro code for summing of leave for employees

    Dear Sir,

    I have attached workbook named Leave.xlsx. The workbook contains two worksheets named Rawdata and Output.

    Kindly provide me a macro code to fetch data from worksheet named Rawdata and display the data in the worksheet named output.

    The worksheet named Rawdata contains two employees which they have availed leave in different dates

    The leave availed should be summed and display it in the worksheet named output for the two employees.

    I have workbook for your reference.

    I don't want to do it in pivot table.

    Regards
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: macro code for summing of leave for employees

    In Output

    in A2

    =IFERROR(INDEX(RAWDATA!$A$2:$A$10, MATCH(0, INDEX(COUNTIF($A$1:$A1, RAWDATA!$A$2:$A$10), 0, 0), 0)), "")

    in B2

    =VLOOKUP($A2,RAWDATA!$A$2:$F$2,COLUMN(B$1),0)

    Copy across

    in G2

    =SUMIF(RAWDATA!$A$2:$A$6,OUTPUT!$A2,RAWDATA!$G$2:$G$6)
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: macro code for summing of leave for employees

    Hi skml,

    Try below code ...
    Please Login or Register  to view this content.
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  4. #4
    Forum Contributor
    Join Date
    10-31-2013
    Location
    india
    MS-Off Ver
    Excel 2019
    Posts
    147

    Re: macro code for summing of leave for employees

    Dear Mr Nank83

    Tested. Working fine.

    Thanks for your response.

    Regards

+ 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] Monthly Statistics of Employees Leave
    By Sherina in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-01-2023, 08:38 AM
  2. Replies: 2
    Last Post: 10-22-2018, 05:41 PM
  3. [SOLVED] VBA to update employees leave
    By notemore in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2017, 06:20 AM
  4. [SOLVED] Need Help to make an Employees Leave Calendar
    By CuriousNancy in forum Excel General
    Replies: 9
    Last Post: 07-27-2015, 08:40 AM
  5. Replies: 5
    Last Post: 03-03-2015, 01:38 PM
  6. Employees Leave Planner
    By mdsharief in forum Excel General
    Replies: 3
    Last Post: 07-16-2012, 09:43 AM
  7. [SOLVED] Security - deny access to workbooks when employees leave company
    By Lewej23 in forum Excel General
    Replies: 3
    Last Post: 05-25-2012, 06:46 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