Very new to VBA, and understand this may be difficult without posting my workbook, but I'll give it try...
On one of my userforms, I have a 2 textboxes, one to enter a beginning date, and another to enter and end date. Just to make the data entry for the dates easier, I decided to download a pre-built, date picker form from the 'net... I liked the Calender Form (not the addin or the combo boxes) found here. I copied the calendar form easy enough and the "frmTest" form too for good measure (though I'm hoping to delete the latter).
I added 2 command buttons next to my begin & end date text boxes in my own userform where I want date to value to go, and named them "FromCal" and "ToCal" respectively. I added the code below to my own userform:
Also added similar code for the"ToCal" command button.
One caveat, the Calendar form code starts with:
...and this gave me an error. I ended up completely deleting that code from the Calendar form in my workbook, and the calendar loaded fine. Maybe it's important and will give me trouble later...
Anyway, it appears the calender form has the code to write the date to the the selected cell in the worksheet with:
So my problem is I don't need the date to go to an active cell, but to my beginning date text box ("txtbgndate") if the corresponding command button is hit, or to the end text box ("txtenddate") for that command button. So is this possible - and from only 1 calendar userform (or would I have to load a separate calender form for each command button)?
-HeyInKy
Bookmarks