Custom Date & Time Range Userform

dcunningham

Board Regular
Joined
Jul 14, 2015
Messages
58
Hi Everyone,

I'm trying to put together a userform where the user selects a date range, inputs a start time and an end time, and then hits a button to input those values combined into two cells. Here's what the userform looks like:
59a55bc251d0b028950e06c10f673de1.png

I have it set so that the user can drag to select the range of dates, up to 365 days.

The problem is, I'm completely new to using userforms in VBA and I have no idea how to code the functionality I need. First, the start/end date of the selected date range on the MonthView selector and the start/end time from the two DTPickers need to be combined. Then, using the "OK" command button, those combined values need to be sent to two cells (say A1 and B1). I suppose the command button could do the combining and delivery of the values to those cells, I just don't know how you pass the values from the MonthView userform and the DTPickers to the command button to do that.

Can anyone steer me towards some resources that will aid me with this? I've looked around, but I either don't know enough to Google effectively or there isn't much out there. Or, if it's relatively simple, give me a place to start?

Here's a link to download a workbook with the userform I created on Google Drive if you're interested: https://drive.google.com/file/d/0B_fZnVjXU9YAb25makNQSHNOMkk/view?usp=sharing.

Regards,

Dan
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

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