Closed Thread
Results 1 to 2 of 2

adapting a downloaded, excel date picker form into my own userform

  1. #1
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    adapting a downloaded, excel date picker form into my own userform

    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:

    Please Login or Register  to view this content.
    Also added similar code for the"ToCal" command button.

    One caveat, the Calendar form code starts with:
    Please Login or Register  to view this content.
    ...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:

    Please Login or Register  to view this content.
    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

  2. #2
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: adapting a downloaded, excel date picker form into my own userform

    Let me re-phrase my question... and maybe someone will have a solution.

    Currently, the Calendar Form writes the date value to the an active cell. What I need the form to do is either recognize which command button was activated (using Me.ActiveControl?) and write the data value to a corresponding text box - OR - I thought about using Case Select, somehow maybe using SetFocus on a given textbox when a command button is activated, and then writing the date value based on where the focus is set... but I'm not sure that's even doable... just some ideas.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Downloaded Date and time picker but not available
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-25-2014, 09:53 AM
  2. Date picker control for Excel 2003 userform
    By GreyGhost in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2014, 06:20 PM
  3. Date picker UserForm to stay always in front of the main UserForm
    By Gabor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-11-2014, 07:31 AM
  4. Adding date and time picker on the Excel form
    By ThePower777 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2012, 04:44 PM
  5. Set up Excel Form with Pop-up Date Picker
    By Vinnie Chan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-07-2010, 01:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1