I have a Userform that I created in Excel 2007 with a Calendar. When I open this in Excel 2010, the Calendar isn't part of that version, so the object is removed from the Userform and I am forced to comment out the calendar script.
I have heard about the Date Picker, but I have no idea how to use it.
Is there a tool I can use to allow the Calendar to come up when the Userform is opened with Excel 2007 and the Date Picker when the program is opened using Excel 2010?
This calendar allows the user to select a date and then the information is passed to a cell where the date is filled in.
I need the script to be versatile between the two and I'm racking my brain trying to figure this out.
Any advice or direction is greatly appreciated. I have no idea where to start when trying to combine the two date options.
Here is what I've done so far on my own... My mind is very scrambled... Please help!
Private Sub cboEnrollmentAdvisor_Change()
End Sub
Private Sub cmdClearForm_Click()
Call UserForm_Initialize
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim NR As Long
'transfer values to database
With ActiveWorkbook.Sheets("November2011")
NR = .Range("A" & .Rows.Count).End(xlUp).Row + 1
.Range("B" & NR).Value = txtFName.Value
.Range("C" & NR).Value = txtLName.Value
.Range("D" & NR).Value = txtIRN.Value
.Range("A" & NR).Value = cboEnrollmentAdvisor.Value
.Range("E" & NR).Value = frmCalendar.Value
End With
'Reset values
txtFName.Value = ""
txtLName.Value = ""
txtIRN.Value = ""
cboEnrollmentAdvisor.Value = ""
frmCalendar.Value = ""
End Sub
Private Sub cmdSubmit_Click()
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub CommandButton1_Click()
Unload Me
ActiveCell.Select
End Sub
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
ActiveCell = MonthView1.Value
Unload Me
ActiveCell.Select
End Sub
Private Sub UserForm_Activate()
If Not IsDate(ActiveCell.Value) Then
Me.MonthView1.Value = Date
Else
Me.MonthView1.Value = ActiveCell.Value
End If
End Sub
Private Sub UserForm_Initialize()
Dim frm As Long, frmstyle As Long
If Val(Application.Version) >= 9 Then
wHandle = FindWindow("ThunderDFrame", Me.Caption)
Else
wHandle = FindWindow("ThunderXFrame", Me.Caption)
End If
If wHandle = 0 Then Exit Sub
frm = GetWindowLong(wHandle, GWL_STYLE)
frm = frm Or &HC00000
SetWindowLong wHandle, -16, frmstyle
DrawMenuBar wHandle
With Me
.Left = ActiveCell.Offset(0, 1).Left
.Top = ActiveCell.Top + ActiveCell.Height + 15
.StartUpPosition = 0
End With
End Sub
Private Sub Image1_Click()
End Sub
Private Sub Label9_Click()
End Sub
Private Sub Degree_Initialize()
txtFName.Value = ""
txtLName.Value = ""
txtIRN.Value = ""
With cboEnrollmentAdvisor
.AddItem "********************************************Undergraduate Degrees*******************************************"
.AddItem ""
.AddItem "Bachelor of Science in Early Childhood Education (Leads to Credential)"
.AddItem "Bachelor of Science in Elementary Education and Special Education (Dual Major) (Eligible for Institutional Recommendation)"
.AddItem "Bachelor of Science in Elementary Education Grades K-8 (Emphasis in Early Childhood Education) (Eligible for Institutional Recommendation)"
.AddItem "Bachelor of Science in Elementary Education Grades K-8 (Emphasis in English) (Eligible for Institutional Recommendation)"
.AddItem "Bachelor of Science in Elementary Education Grades K-8 (Emphasis in Math) (Eligible for Institutional Recommendation)"
.AddItem "Bachelor of Science in Elementary Education Grades K-8 (Emphasis in Science) (Eligible for Institutional Recommendation)"
.AddItem "Bachelor of Science in Secondary Education (Emphasis in Business Education) (Eligible for Institutional Recommendation)"
.AddItem "Bachelor of Science in Secondary Education (Emphasis in English) (Eligible for Institutional Recommendation)"
.AddItem "Bachelor of Science in Secondary Education (Emphasis in Math) (Eligible for Institutional Recommendation)"
.AddItem "Bachelor of Science in Secondary Education (Emphasis in Social Studies) (Eligible for Institutional Recommendation)"
.AddItem "Bachelor of Science in Secondary Education with an Emphasis in Biology (Eligible for Institutional Recommendation)"
.AddItem "Bachelor of Science in Secondary Education with an Emphasis in Chemistry (Eligible for Institutional Recommendation)"
.AddItem "Bachelor of Science in Secondary Education with an Emphasis in Physical Education (Eligible for Institutional Recommendation)"
.AddItem ""
.AddItem ""
.AddItem "********************************************Graduate Degrees*******************************************"
.AddItem ""
.AddItem "Master of Arts in Teaching with an Emphasis in Professional Learning Communities (Not Eligible for Institutional Recommendation)"
.AddItem "Master of Arts in Teaching with an Emphasis in Teacher Leadership (Not Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Curriculum and Instruction: Reading with an Emphasis in Elementary Education (Not Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Curriculum and Instruction: Reading with an Emphasis in Secondary Education (Not Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Curriculum and Instruction: Technology (Not Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Early Childhood Education (Leads to Credential)"
.AddItem "Master of Education in Early Childhood Education (Not Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Educational Administration (Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Educational Leadership (Not Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Elementary Education (Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Elementary Education (Not Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Elementary Education: Arizona Teaching Intern Certificate Program (Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Secondary Education (Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Secondary Education: Arizona Teaching Intern Certification Program (Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Special Education for Certified Special Educators (Not Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Special Education: Cross-Categorical (Not Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Special Education: Cross-Categorical: Arizona Teaching Intern Certification Program (Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Special Education: Cross-Categorical (Eligible for Institutional Recommendation)"
.AddItem "Master of Education in Teaching English to Speakers of Other Languages (TESOL) (Not Eligible for Institutional Recommendation)"
End With
cboEnrollmentAdvisor.Value = ""
End Sub
Private Sub CommandButton1_Click()
End Sub
Bookmarks