Form Date picker

R

Rob Hargreaves

Hi,

Do you know if I can get a coded date picker to work in
my excel sheet I need it to output to a cell on the sheet.

Thanks

Rob
 
R

Rob

Mike,

I have got an open worksheet and on there I have through
the form toolbar added a calendar 10.0

The calendar is sitting just where and is formatted as I
would like too.

I have been trying to write this -

Private Sub Calendar1_AfterUpdate()

'Application.Worksheets("Daily").Range("C4").Value =
Calendar1.Value
Application.Worksheets("Daily").Range("C4").Value =
Calendar1.Value

End Sub

can you tell me where I am wrong?

- The sheet the calendar is on and the sheet I want the
output to is called "Daily"
- I want to click on any date and the cell C4 will update
with the value selected on the calendar

Thanks

Rob
 
R

Ron de Bruin

Use this

Private Sub Calendar1_Click()
If CDbl(Calendar1.Value) > Date Then
MsgBox "The date must be before now"
Else
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "mm/dd/yyyy"
ActiveCell.Select
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Error with Date Picker 3
Date Picker component 1
Set date time picker to null (blank) 5
Date Time Picker 2
Date Picker 2
Date & Time Picker Control 6.0 2
DT Picker 8
Outlook from .dotx to .oft 1

Top