phendrena
11-05-2008, 06:54 AM
Hi,
I've got two userforms.
The second userform is a calendar.
I want the date picked from the calendar to be placed into the field txtDate on userform1. How can i do this? I'm adapting the code from code I have that places the data into the current cell....
Private Sub frmCalendar_Click()
ActiveCell = frmCalendar.Value
ActiveCell.NumberFormat = "dd/mm/yyyy"
End Sub
Private Sub UserForm_Activate()
If IsDate(ActiveCell.Value) Then
frmCalendar.Value = DateValue(ActiveCell.Value)
Else
frmCalendar.Value = Date
End If
End Sub
How can i get it to be entered into the userform rather than the worksheet cell. I know i'm going to need to change the ActiveCell but to what.
Thanks,
I've got two userforms.
The second userform is a calendar.
I want the date picked from the calendar to be placed into the field txtDate on userform1. How can i do this? I'm adapting the code from code I have that places the data into the current cell....
Private Sub frmCalendar_Click()
ActiveCell = frmCalendar.Value
ActiveCell.NumberFormat = "dd/mm/yyyy"
End Sub
Private Sub UserForm_Activate()
If IsDate(ActiveCell.Value) Then
frmCalendar.Value = DateValue(ActiveCell.Value)
Else
frmCalendar.Value = Date
End If
End Sub
How can i get it to be entered into the userform rather than the worksheet cell. I know i'm going to need to change the ActiveCell but to what.
Thanks,