Create an Attendance Report with Excel sheet

Last update on October 20, 2009 08:59 AM by aakai1056
Published by aakai1056

Create an Attendance Report with Excel sheet




Issue



In the case you want to create an attendance report with Excel , here below you will find a nice example:

Consider that your report will have the following parameters:

You have 60 residents working in our department. They attend morning report everyday. So I have prepared excel sheet( Named Attendance Table) which has column A1:A60 with names of residents B1:B60 with percentage of attendance for one month.



Once the Template for attendance report is created you want to run a Macro which will do following things:
  • 1. Open a new worksheet from the template in the workbook which has "Attendance Table worksheet"
  • 2. It should bring the data from "Attendance Table" worksheet
    • a. From First column A1 and put in Name field of template ( new worksheet opened in stage one) ( Always D6)
    • b. bring data from B1 and put in Percentage field of Template (F10)
    • c. It should rename the worksheet tab with Data from A1 (i.e. name of the resident)
  • 3. It should repeat the step 2 till it reaches the empty cell

Solution


' Attendance Report Subroutine to 
' Open New Worksheet called attendance tqable worksheet 
' With data from Attendance Table 
' Residents name to D6 
' Percentage of attendnace for one month to F10 
' Rename sheet to residents name and start again 
' For all residents in table 

Sub AttendanceReport() 
Dim cCell As Object, i As Integer 'Two variables cCell (current Cell) object and i (standard counting integer) 
Cells(1, "A").Select 'Ensure that we start each time at the top of the worksheet 
Application.ScreenUpdating = False 'Turn of screen updates whilst macro is running 
For Each cCell In Range(Cells(1, "A"), Cells(1, "A").End(xlDown)) 'Will run our code through each cell with text 
Set NewSheet = Sheets.Add(Type:=xlWorksheet) 'Add new worksheet 
NewSheet.Name = "Attendance Table Worksheet" 'rename worksheet 
Sheets("Attendance Table Worksheet").Cells(6, "D").Value = cCell.Value 'put residents name is cell D6 
Sheets("Attendance Table Worksheet").Cells(10, "F").Value = cCell.Offset(0, 1).Value 'put residence attednance into F10 
Sheets("Attendance table worksheet").Name = cCell.Value 
Next cCell 
End Sub


Thanks to Jimmy for this tip.
Best answers for « Create an Attendance Report with Excel sheet » in :
Avoid duplicates in Excel ShowAvoid duplicates in Excel In order to avoid duplication when encoding in a column from an excel sheet: take the conditional format on the first cell under the headings (eg A2) choose the following formula:...
How to freeze a row in an excel sheet ShowHow to freeze a row in an excel sheet To freeze a line in an excel sheet, for example line 1: Select line 2. Go to menu Window and select Freeze panes.
Import contacts from Excel to Outlook ShowImport contacts from Excel to Outlook Issue Solution Issue How to import a contact list from Excel to Outlook and having them in a single list of contact , and not as splited items? Solution By using the software Excel 2000 and...
Linux - The shell ShowIntroduction to the shell The command interpreter is the interface between the user and the operating system, hence the name "shell". The shell therefore acts as an intermediary between the operating system and the user thanks to command lines...