Jenna_B
New Member
- Joined
- Sep 22, 2016
- Messages
- 28
- Office Version
-
- 365
- Platform
-
- Windows
Good morning all!
I am having a considerable amount of trouble trying to use a calendar in a userform. I am trying to get the userform to have a datepicker in it and from there write the selection to a spreadsheet. Obviously I am not inputting something correctly in my code, someone please help!
I am having a considerable amount of trouble trying to use a calendar in a userform. I am trying to get the userform to have a datepicker in it and from there write the selection to a spreadsheet. Obviously I am not inputting something correctly in my code, someone please help!
Code:
Private Sub CommandButton2_Click()
Dim lRow As Long
Dim ws As Worksheet
Set ws = Worksheets("RSM Input")
lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ws
.Cells(lRow, 1).Value = Me.Territory.Value
.Cells(lRow, 2).Value = Me.Activity.Value
.Cells(lRow, 3).Value = Me.ManType.Value
.Cells(lRow, 4).Value = Me.DateTimePicker1.Value
End With
Me.Territory.Value = ""
Me.Activity.Value = ""
Me.ManType.Value = ""
Me.DateTimePicker1.Value = ""
End Sub