+ Reply to Thread
Results 1 to 3 of 3

Date flipping

  1. #1
    Registered User
    Join Date
    05-18-2012
    Location
    Liverpool
    MS-Off Ver
    Excel 2013
    Posts
    76

    Date flipping

    I have searched all night and nothing helps fix my problem
    i have a userform2 and a textbox5 in which i enter the date UK dd/mm/yyyy

    If wsFU.Range("B20").CurrentRegion.Rows.Count <> 1 Then
    Set nfu = wsFU.Range("B20").CurrentRegion.End(xlDown).Offset(1).Resize(1, 9)
    Else
    Set nfu = wsFU.Range("B20").CurrentRegion.Offset(1).Resize(1, 9)
    End If

    With nfu
    '***************************************************************
    i have used .Cells(1).Value = UserForm2.TextBox5.Value 'DATE
    i have used .Cells(1).Value = CDate(Me.TextBox5.Value) 'DATE
    but its still putting the date on the sheet in us form not UK aaaarrrhhhh


    i have also
    Private Sub TextBox5_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
    On Error Resume Next
    Me.TextBox5 = CDate(Me.TextBox5)
    End Sub

    please can someone tell me what im doing wrong please

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Date flipping

    Try using DateValue. You may want to set the cell date format as well.

    .Cells(1).Value = DateValue(Me.TextBox5.Value)
    .Cells(1).NumberFormat = "dd/mm/yyyy"


    This is from the Remarks section for DateValue help.

    Remarks

    If date is a string that includes only numbers separated by valid date separators, DateValue recognizes the order for month, day, and year according to the Short Date format you specified for your system.
    Last edited by AlphaFrog; 02-03-2016 at 06:40 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Date flipping

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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] flipping on monitor
    By anilg0001 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-28-2013, 05:19 AM
  2. flipping array
    By rize1159 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-05-2011, 01:14 PM
  3. Flipping Data
    By RynMan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-07-2009, 01:14 AM
  4. [SOLVED] Data Flipping
    By Steph in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-01-2005, 04:09 PM
  5. Flipping a name
    By Duncan_J in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-18-2005, 03:06 PM
  6. RE: Flipping a name
    By Jim Thomlinson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-18-2005, 01:06 PM
  7. RE: Flipping a name
    By Trent Argante in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-18-2005, 01:06 PM
  8. Data Flipping
    By alamsemu in forum Excel General
    Replies: 1
    Last Post: 03-10-2005, 02:07 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