How to Generate Absent Dates in a Single Cell in Excel (2022)
First create an attendance sheet as shown below. We already have shown how to create this attendance sheet, if you want to learn, click here.
Generate Row number & Column number
First we need to generate the row number and column number of the cell in which we are doing attendance. And these row number and column number will help us to generate the dates related to that cell. Suppose we mark A in cell C7 then in cell A4 we will get the row number as 7 and in B4 we will get the column number as 3. Based on these row number and column number we will generate the date of that column (i.e. column C) , the date will be 01.
Now type the code given below:
Now change any cell value within C7:AF16, you will notice row number and column number will appear in A4 and B4 respectively.
Now we will create another module/macro to generate the date in the report based on that row number and column number.
Generate Date in Report
Again go to Visual Basic Editor, and click Insert â–º Module. Insert the code given below:
Now we will add another code in Worksheet Change procedure to trigger the above code. Double-Click on Sheet1 and Just type Call AbsentDate before End If.
Now change the cell value to A and you will see dates will appear on the Absent Dates column in Report.
Similarly if you want to do it for Leave Dates column, then repeat the same procedure.
0 Comments