+ Reply to Thread
Results 1 to 10 of 10

Excel 2003, vb, form calendar date - set to todays date

  1. #1
    Registered User
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Excel 2003, vb, form calendar date - set to todays date

    Hi everyone...

    Thanks to anyone in advance who can help me here.

    Im designed a form in excel, which has a calendar date picker to select a desired delivery date for the user, which makes it easier to use for the user, than using a text box.

    Ive searched a number of websites and so far havent seen what I need.

    I want the calendar, once my form has been opened, to automatically change to the current date.

    So in summary, the code, I believe would look something like this:

    Please Login or Register  to view this content.
    I seem to error with this...

    Is there an alternative method? For some reason it always seems to only remember the previously used date.

    Any help would be great.
    Last edited by royUK; 04-21-2009 at 11:24 AM. Reason: add code tags

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel 2003, vb, form calendar date - set to todays date

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel 2003, vb, form calendar date - set to todays date

    I have added code tags for you.

    Take a look at he code in he calendar form posted here

  4. #4
    Registered User
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Excel 2003, vb, form calendar date - set to todays date

    Thank you for your help. It is appreciated.

    Your calendar, as good as it is... would appear to involve a lot of additional work to be able to "insert" in into my code and then also into my own designed form, which has a lot on it already. Seems a long winded way around a problem, but I will give it a go and see how I get on, I also need to make it smaller... it might be ok...

    This aside, has anyone got any ideas on just how to make the built in excel calendar one to work as it should and auto change to the "todays date"?

    Many thanks.
    Last edited by continental; 04-22-2009 at 04:49 AM.

  5. #5
    Registered User
    Join Date
    04-14-2009
    Location
    Queensland
    MS-Off Ver
    MSOffice 2003
    Posts
    11

    Question Re: Excel 2003, vb, form calendar date - set to todays date

    Hello c/nental,

    ...not entirely clear what outcome you want but everytime I imbed the excel calendar (Calendar control 11.0) in excel 03, it always open with the current date...then I have code in a module so that when a date is picked it would be entered in a cell somewhere in the active sheet or other...

    My understanding from your post - the user needs to determine a suitable delivery date - to do this, they would pop the calendar (with current date) and then pick another date.

    Q - what do you want to happen when they click on the chosen date?

    Cheers.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel 2003, vb, form calendar date - set to todays date

    You won't find it "long winded" if you distribute your workbook to someone who does not have the calendar control installed on their computer!

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel 2003, vb, form calendar date - set to todays date

    Use the form's initialize event to set the date

    Please Login or Register  to view this content.
    You won't find the altenative "long winded" when you distribute your workbook to someone who hasn't got the calendar control installed!
    Last edited by royUK; 04-22-2009 at 07:45 AM.

  8. #8
    Registered User
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Excel 2003, vb, form calendar date - set to todays date

    Quote Originally Posted by nauti View Post
    Hello c/nental,

    ...not entirely clear what outcome you want but everytime I imbed the excel calendar (Calendar control 11.0) in excel 03, it always open with the current date...then I have code in a module so that when a date is picked it would be entered in a cell somewhere in the active sheet or other...

    My understanding from your post - the user needs to determine a suitable delivery date - to do this, they would pop the calendar (with current date) and then pick another date.

    Q - what do you want to happen when they click on the chosen date?

    Cheers.
    Hi Nauti, Thanks a lot for your reply.

    For some reason, the form's calendar seems to reflect the last selected date, ( have you tested yours after todays date for example?) therefore this might be last month for example, so I wanted to "force" the date to be correct in the first place ( most likely todays date ) and provide the user to select an alternative date. The problem is, without it forcing to the current date, its easily missed if the month is wrong and the user doesnt notice that.

    The date, is then, along with a lot of other drop down data and text forms, fills out a table on a worksheet, compiles a unique order ID number and sorts it for a pivot table, ready to print as a Purchase Order.

    Its nearly done, just couldnt get the date to work properly.



    Also thanks for your reply Roy,
    Quote Originally Posted by royUK View Post
    You won't find it "long winded" if you distribute your workbook to someone who does not have the calendar control installed on their computer!
    I am actually the IT manager at our site and have already installed on each pc's here all the necessary functions for every application needed anyway, so it wouldnt be an issue.

    I just want the picker to work as it should, thats all.
    Last edited by continental; 04-22-2009 at 09:38 AM.

  9. #9
    Registered User
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Excel 2003, vb, form calendar date - set to todays date

    Quote Originally Posted by royUK View Post
    Use the form's initialize event to set the date

    Please Login or Register  to view this content.
    Ah ha... Thats what I needed in the first place.

    I'll give this a go and try it out and let you know... thank you so much in advance.

  10. #10
    Registered User
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Excel 2003, vb, form calendar date - set to todays date

    Quote Originally Posted by royUK View Post
    Use the form's initialize event to set the date

    Please Login or Register  to view this content.
    Ah ha... Thats what I needed in the first place.

    I'll give this a go and try it out and let you know... thank you so much in advance.
    Last edited by continental; 04-22-2009 at 09:51 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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