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:
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
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:

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