+ Reply to Thread
Results 1 to 6 of 6

Date formatting help

  1. #1
    Forum Contributor
    Join Date
    09-05-2008
    Location
    UK
    Posts
    103

    Date formatting help

    Hi

    Hoping someone can help, I have the below code that pulls data from specific cells in active sheet to a userform. Even though the cells are formatted as date (dd/mm/yy) the userform shows it as mm/dd/yy.

    Please Login or Register  to view this content.
    I have been searching since yesterday and had no luck with this.

    Thanks in advance

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Date formatting help

    have tried this? i know you are doing in other areas...

    [code]
    Private Sub Userform_Activate()
    With Me
    .TextBox1.Value = Format(Range("B7").Value, "dd/mm/yy")
    .TextBox2.Value = Format(Range("L7").Value, "dd/mm/yy")
    .TextBox3.Value = Range("C7").Value ' do the rest '''
    .TextBox4.Value = Range("D7").Value
    .TextBox5.Value = Range("E7").Value
    .TextBox6.Value = Range("G7").Value
    .TextBox7.Value = Range("F7").Value
    .TextBox8.Value = Range("H7").Value
    End With
    End Sub
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Forum Contributor
    Join Date
    09-05-2008
    Location
    UK
    Posts
    103

    Re: Date formatting help

    I have tried all sorts. I now getting a false value. when sending textbox with date to cell. see below by codes

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    is there a copy paste function instead. The information in userform is correct for what i need. So when sending to cells in "calc" sheet couldnt just copy paste as it is,

  4. #4
    Forum Contributor
    Join Date
    09-05-2008
    Location
    UK
    Posts
    103

    Re: Date formatting help

    Sorry, yes that working for pulling info. Its just sending dates back in wrong format
    Quote Originally Posted by judgeh59 View Post
    have tried this? i know you are doing in other areas...

    [code]
    Private Sub Userform_Activate()
    With Me
    .TextBox1.Value = Format(Range("B7").Value, "dd/mm/yy")
    .TextBox2.Value = Format(Range("L7").Value, "dd/mm/yy")
    .TextBox3.Value = Range("C7").Value ' do the rest '''
    .TextBox4.Value = Range("D7").Value
    .TextBox5.Value = Range("E7").Value
    .TextBox6.Value = Range("G7").Value
    .TextBox7.Value = Range("F7").Value
    .TextBox8.Value = Range("H7").Value
    End With
    End Sub

  5. #5
    Forum Contributor
    Join Date
    09-05-2008
    Location
    UK
    Posts
    103

    Re: Date formatting help

    Just in case this pops up on someones search. Overcome my problem by using CDATE

    Please Login or Register  to view this content.

  6. #6
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Date formatting help

    always nice to figure it out on your own....

    If this has been completed to your satisfaction, please set the thread to Solved...If you feel I deserve an increase in our reputation, feel free to click on the star in the lower left of the thread. Remember, someday when you help somebody they may add to your rep points, and it could be me...just a thought...

+ 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. Replies: 3
    Last Post: 11-23-2013, 06:21 AM
  2. Replies: 2
    Last Post: 09-19-2013, 10:34 AM
  3. Replies: 5
    Last Post: 08-22-2012, 05:06 PM
  4. Replies: 3
    Last Post: 07-11-2012, 10:03 AM
  5. Replies: 3
    Last Post: 08-18-2010, 12:58 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