Hi everyone, VBA noob here. I'm trying to make a robust attendance tracker for my director, and am approaching the finish line. On the first sheet is the roster of people with adjacent drop-downs to select "here" or "absent,", and on the second sheet is a tracker that records the date each time someone is marked absent and counts the total.
I have created a button that "resets" the form, which I've defined as changing everyone's status back to "here," and converts the formulas on the second sheet that record the date to their value (like F9 function), then copies the same formula over 1 cell. Here's my code:
Private Sub CommandButton1_Click()
Sheets("Tracker").Select
Sheets("Tracker").Range("B2").End(xlToRight).Value = Range("B2").End(xlToRight).Value
Sheets("Tracker").Range("B2").End(xlToRight).Offset(0, 1) = "=IF(OR(INDIRECT(""RC[-1]"",0)=Form!$C$2,INDIRECT(""RC[-1]"",0)=""""),"""",IF(Form!$B$5=""Absent"",TODAY(),""""))"
Sheets("Form").Range("B5:B14").Value = "Here"
Sheets("Form").Range("D5:D15").Value = "Here"
Sheets("Form").Range("F5:F17").Value = "Here"
Sheets("Form").Range("H5:H16").Value = "Here"
MsgBox "Attendance has been reset!"
End Sub
This works successfully with one person, and now I just want to repeat the first 3 commands through the range B3:B47.
Would this require a Loop?
Thanks,
JordanAbu
Bookmarks