I made an attendance register (using Excel 2013) for my classroom about 2 years ago.
It uses MonthView to select dates from a form for new student admissions.
My problem NOW, is that the Monthview is still stuck in 2014 every time the form pops open. How can I change the MonthView so it reflect the current year and month when it opens?
I am pasting all of my code below.
Thanks for any suggestions.
It uses MonthView to select dates from a form for new student admissions.
My problem NOW, is that the Monthview is still stuck in 2014 every time the form pops open. How can I change the MonthView so it reflect the current year and month when it opens?
I am pasting all of my code below.
Thanks for any suggestions.
Code:
Private Sub cmdEnterData_Click()
Dim i As Integer
i = 2
While ThisWorkbook.Worksheets("Admissions").Range("B" & i).Value <> ""
i = i + 1
Wend
ThisWorkbook.Worksheets("Admissions").Range("D" & i).Value = MonthView1.Value
ThisWorkbook.Worksheets("Admissions").Range("B" & i).Value = ComboBox2.Value
ThisWorkbook.Worksheets("Admissions").Range("C" & i).Value = ComboBox1.Value
Range("AC38").Select
i = 1 'set as the first ID
Do Until ActiveCell.Value = Empty
ActiveCell.Offset(1, 0).Select 'move down 1 row
'keep a count of the ID for later use
Loop
'Populate the new data values into the 'Data' worksheet.
ActiveCell.Value = Me.MonthView1.Value
Me.MonthView1.Value = Empty
Me.ComboBox2.Text = Empty
Me.ComboBox1.Text = Empty
Me.ComboBox2.SetFocus
Unload Me
End Sub
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
End Sub
Private Sub UserForm_Initialize()
Dim sht As Worksheet, txt As String
For Each sht In ActiveWorkbook.Sheets
Me.ComboBox2.AddItem sht.Name
Next sht
Me.ComboBox1.AddItem "Internal Admission"
Me.ComboBox1.AddItem "External Admission"
'ComboBox1 = List.Array("External Admission", "Internal Admission")
End Sub
Private Sub cmdClose_Click()
'close the form (itself)
Unload Me
End Sub