+ Reply to Thread
Results 1 to 6 of 6

using Calendar form to store a date changes my system date/time

  1. #1
    Registered User
    Join Date
    11-11-2009
    Location
    Alpharetta, GA
    MS-Off Ver
    Excel 2007
    Posts
    12

    using Calendar form to store a date changes my system date/time

    Everytime I run my vba code using the calendar to store the date, it changes my system date & time. this causes problems when my system date/time does not match my network date/time.

    How can I fix this?

    Please Login or Register  to view this content.
    Last edited by mslynng; 11-11-2009 at 05:26 PM.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: using Calendar form to store a date changes my system date/time

    Per forum rules VBA code tags are required when posting any VBA code.

    Please wrap your VBA code in code tags. Highlight all of the code then click the # button. Thanks.

    Once this is done solutions to your question will be provided.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    11-11-2009
    Location
    Alpharetta, GA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: using Calendar form to store a date changes my system date/time

    I corrected the code. Sorry...

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: using Calendar form to store a date changes my system date/time

    I would change or remove this line:
    Please Login or Register  to view this content.
    VBA Date works the same as the TODAY() function, meaning it reads the current date/time per your current system/region settings in the OS.

    The way you structured the code, you are specifying the Date to be whatever value is clicked in the calendar, which may be different from the current system date. Although, it's not clear to me how this could affect settings in the OS (if at all).

    If your intention is for the calendar to have the current date selected, then
    Please Login or Register  to view this content.
    You can shorten the code in the button_click event to this. There is no need to activate the sheets in order to place a value into a cell or use for the With statements.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-11-2009
    Location
    Alpharetta, GA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Smile Re: using Calendar form to store a date changes my system date/time

    Thanks again! I will try it.

  6. #6
    Registered User
    Join Date
    11-11-2009
    Location
    Alpharetta, GA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Thumbs up Re: using Calendar form to store a date changes my system date/time

    Thanks again! This worked.

+ 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