This code is to mark attendance from the zoom master excel file.
Sub KeepOnlyAtSymbolRows()
Dim ws As Worksheet
Dim rng As Range
Dim lastRow As Long
Set ws = ActiveWorkbook.Sheets("Sheet1")
Range("W2").Value = "CWRT"
Range("W3").Value = "MTH"
Range("W4").Value = "GRCM"
Range("W5").Value = "LAN"
Range("W6").Value = "LEN"
Range("F2").Formula = "=IF(ISNUMBER(FIND($W$2,A2)), 1,IF(ISNUMBER(FIND($W$3,A2)), 1,IF(ISNUMBER(FIND($W$4,A2)), 1,IF(ISNUMBER(FIND($W$5,A2)), 1,IF(ISNUMBER(FIND($W$6,A2)), 1,0)))))"
Range("F2").AutoFill Destination:=Range("F2:f500000")
lastRow = ws.Range("A" & ws.Rows.Count).End(xlUp).Row
Set rng = ws.Range("F1:F" & lastRow)
' filter and delete all but header row
With rng
.AutoFilter Field:=1, Criteria1:="<>1"
.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
' turn off the filters
ws.AutoFilterMode = False
Range("B:H,J:N,Q:W").EntireColumn.Delete
Range("B2").Formula = "=int(D2)"
Range("B2").AutoFill Destination:=Range("B2:B100000")
For Each ws In ActiveWorkbook.Sheets
ws.UsedRange.Value = ws.UsedRange.Value
Next
Dim SampleRange As Range
Dim KeyColumns As Variant
'select the range where data exist
Set SampleRange = Range("A:C")
'Set the arry size to maximum number of columns
TotalColumns = SampleRange.Columns.Count
ReDim KeyColumns(0 To TotalColumns - 1)
'Assign values to each array element
For i = 0 To TotalColumns - 1
KeyColumns(i) = i + 1
Next i
'Remove the duplicates based on all columns
SampleRange.RemoveDuplicates Columns:=(KeyColumns), Header:=xlYes
Sheets.Add.Name = "Sheet2"
End Sub
Sub DateEmailRead()
Range("e2").Formula = "=COUNTIFS('Sheet1'!$c:$c,$D2,'Sheet1'!$b:$b,E$1)"
Range("e2").AutoFill Destination:=Range("e2:e2000")
Range("e2:e2000").AutoFill Destination:=Range("e2:AA2000")
Range("AB2").Formula = "=SUM(E2:AA2)"
Range("AB2").AutoFill Destination:=Range("AB2:AB2000")
Range("AE2").Formula = "=(AB2/AD2)*100"
Range("AE2").AutoFill Destination:=Range("AE2:AE2000")
Range("AC2").Formula = "=COUNTA($E$1:$AB$1)"
Range("AC2").AutoFill Destination:=Range("AC2:AC2000")
Range("AB1").Value = "Total"
Range("AC1").Value = "Class Days"
Range("AD1").Value = "Total Classes"
Range("AE1").Value = "Percentage"
End Sub
After the execution of the data, the file that I recieved is this.
But the issue is that many of the students having siblings shares one laptop uses the id thus due to this one of the sibling is marked absent as they are not using their own id. So I decided to use the siblings data in one sheet and create a connection such that if the students father name is the same as anyother student in the sibling sheet mark his attendance as present.
Im confused how to do it.
Bookmarks