macro with Date and time picker

Linde

Board Regular
Joined
Dec 27, 2007
Messages
72
Hello Everybody,
:confused:
The Date and time Picker 6.0 from microsoft is giving me a hard time. I have some data in an Excel 2003 sheet that I want to work with.

I can save a selected date from the date and time picker (on a form with lot's of other data) in to the sheet using: cells(4,4).value=Dtp1.value. No problem with the new created information.
Now I want to load the data from the excel sheet into the value of the Dtp1.vale.
It won't work, I Used Format(), I tried a date variable but It won't work

Wat am I doing Wrong,
Does enyone now the right way to give Dtp1 the date from the excel 2003 Sheet?

Hope to hear from you soon,

Harm
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hello Linde,

I created a UserForm with a DTPicker and a command button. he command button sets the DTPicker to the value in cell "A1" of the ActiveSheet. The code checks if the value is a date before setting the DTPicker control.
Code:
Private Sub CommandButton1_Click()

    With Range("A1")
      If IsDate(.Value) Then DTPicker1.Value = .Value
    End With
    
End Sub
Sincerely,
Leith Ross
 
Upvote 0
Hi everyone,

I installed an other version of the date and time picker.
I'm able to change the value of the object. But if I want to manauly adjust the date it keeps it's value.

I Don't understand,
Does enyone have these experience?

Harm
 
Upvote 0
Try using DateValue to convert the value in the cell to a 'real' date - it might not be being recognised as one.

That could be because of formatting or other things.
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,700
Members
448,979
Latest member
DET4492

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top