Is there a Time Control for Excel VBA

DRJ

MrExcel MVP
Joined
Feb 17, 2002
Messages
3,853
I want to have a date and time inputted onto a user form. I use a calendar control which is great. I was wondering if there was a time control. Something like what is brought up when you adjust the system time on the PC. The user can adjust the clock and the userform would received the appropriate time.

Also is there any way to send data when a user form is called? Right now I have 4 seperate userforms with a calendar control on it 'cause I need the data to go to different locations depending on which form was used, but all the forms are the some so if I could call it with a number then I could just use a case select to tell it where to put the data.

Thanks
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I'm not sure which program installs this, I believe its VB 6, but maybe search for one called 'Microsoft Date and Time Picker". Once you have it, change the 'Format' property to '2 - dtpTime'.
 
Upvote 0
Thank you Juan! I had the exact same question as DRJ.

Just writing to let others know that it was already in my list of controls for Excel 2002.

Cheers!

-Sean
 
Upvote 0
Is there a way to make the date and time picker allow selection of BOTH a date and time, the formats I see are only for date OR time...
 
Upvote 0
For sending a number to a form when you show it, I use a global variable declared in a module. Just set the value before you show the form, and then check the value in the form activate to determine what needs to be shown.

This can also work the other way, if you need to send a response back from a userform.
 
Upvote 0
What i am looking for is a form control that allows a user to pick the date and time at the same time. I got the date time picker to show the date and a time in formatting the control, but the user can still only choose the date and the time always shows 12:00...
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,262
Members
449,075
Latest member
staticfluids

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