+ Reply to Thread
Results 1 to 9 of 9

How to Add a date in a TextBox from a CalendarDatePicker in VBA

  1. #1
    Registered User
    Join Date
    12-03-2014
    Location
    Scotland
    MS-Off Ver
    2013
    Posts
    11

    How to Add a date in a TextBox from a CalendarDatePicker in VBA

    Hi

    I'm trying to get a date from a datepicker calendar to input into a userform textbox.

    I have a TextBox and commandbutton next to it, when the commandbutton is clicked the calendar userform I created loads up.

    I just can't seem to find the code to get the date selection to show in the textbox - Does anyone know how to code this?

    Any help would be great!

    Thank you all!

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to Add a date in a TextBox from a CalendarDatePicker in VBA

    I also have 2013 but have no datepicker. I may have to revisit that.

    When I had a datepicker

    I used the Datepickers change event

    NB: Pseudocode:

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    12-03-2014
    Location
    Scotland
    MS-Off Ver
    2013
    Posts
    11

    Re: How to Add a date in a TextBox from a CalendarDatePicker in VBA

    Quote Originally Posted by mehmetcik View Post
    I also have 2013 but have no datepicker. I may have to revisit that.

    When I had a datepicker

    I used the Datepickers change event

    NB: Pseudocode:

    Please Login or Register  to view this content.
    Thank you for your response Mehmetcik.

    Sorry I should have stated I'm actually using Office 2007/2010 for this now userform - this is how I found the datepicker calendar.

    Where does that code go?

    Thanks again!

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to Add a date in a TextBox from a CalendarDatePicker in VBA

    In the userform

    go to visual basic

    view project explorer

    click on the userform

    double click on the userform

    You should be viewing the code

    at the top left there is a combobox. select Datepicker

    On the top right is another combobox select change.

    Vba should create a new macro like:-

    Please Login or Register  to view this content.

    Edit the code and put it in there.

  5. #5
    Registered User
    Join Date
    12-03-2014
    Location
    Scotland
    MS-Off Ver
    2013
    Posts
    11

    Re: How to Add a date in a TextBox from a CalendarDatePicker in VBA

    Thanks for your help. I've given this a try but its still not showing a date in the textbox when I click on the date in the pop-up calendar.

    I've looked all over the internet and the only code I found was for adding the date to a cell in a worksheet, not a textbox.

    Any other suggestions?

    Thanks again!

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to Add a date in a TextBox from a CalendarDatePicker in VBA

    are you using
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    ?

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to Add a date in a TextBox from a CalendarDatePicker in VBA

    are you using
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    ?

  8. #8
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to Add a date in a TextBox from a CalendarDatePicker in VBA

    are you using
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    ?

  9. #9
    Registered User
    Join Date
    12-03-2014
    Location
    Scotland
    MS-Off Ver
    2013
    Posts
    11

    Re: How to Add a date in a TextBox from a CalendarDatePicker in VBA

    Quote Originally Posted by mehmetcik View Post
    are you using
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    ?

    Hi

    I've tried both but neither are working...

    Thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Textbox Date
    By Jerroldac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2014, 11:57 AM
  2. [SOLVED] Date in Textbox
    By seemanthv in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-06-2014, 06:21 AM
  3. Adding one TextBox with weeks to text box with date to give final Date
    By davidloops in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-21-2013, 08:25 PM
  4. [SOLVED] Date in TextBox
    By damorrison in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-06-2006, 05:35 PM
  5. [SOLVED] Compare date in cell to date in Textbox
    By asmenut in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2006, 10:55 AM

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