+ Reply to Thread
Results 1 to 4 of 4

Date Value from UserForm moved to Sheet changes Format.

  1. #1
    Registered User
    Join Date
    10-18-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    19

    Date Value from UserForm moved to Sheet changes Format.

    Hello Forum

    I have a UserForm StudentAttendance which has a running Date and Clock. Code crude but works.

    When I click Attendance Button, Data from UserForm is sent to Sheet2014. However the Date changes from Specified (Now, "dd:mm:yyyy") to Saturday, 0 January 1900.

    I changed the column format in sheet but has no effect, always displays the same.

    I have Included sheet for reference.

    Any assistance would be greatly appreciated....Thank you again.
    Attached Files Attached Files

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Date Value from UserForm moved to Sheet changes Format.

    Hi, msaric,

    I changed the code a bit:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    10-18-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Date Value from UserForm moved to Sheet changes Format.

    Hi Holger
    Much appreciate your swift reply. Tried the revised code but ran into bug at the line.

    .Cells(lngRow, 3) = CDate(TextBox1.Text)

    Any suggestions please.

    Just out of curiosity what does the lng in the variable denote in the code.

    Trying to understand.

    Thank you again.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Date Value from UserForm moved to Sheet changes Format.

    Hi, msaric,

    Excel/VBA should show a error number on that line - could you please pass that number?

    Row is a VBA keyword, I prefer to show what kind of variable I use (Type Long).

    Ciao,
    Holger

+ 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. [SOLVED] Userform date entered in UK format but showing in US Format in spreadsheet
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-23-2013, 01:59 PM
  2. Moved Row to Another Sheet on Conditional Format
    By jojithedevil in forum Excel General
    Replies: 4
    Last Post: 03-11-2013, 07:58 PM
  3. UserForm(s) overlapped if it's moved...
    By john55 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2012, 12:26 PM
  4. Userform date format reverting back to us format on change event
    By jpruffle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2009, 12:34 PM
  5. Moved Userform Controls Don't Work
    By msleger in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-27-2008, 04:55 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