Consulting

Results 1 to 5 of 5

Thread: Solved: Date Formatting using a Textbox on a UserForm

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,285
    Location
    I'm using variables when working with dates (living in belgium i've got the same problem - 02/05/06 becomes 05/02/06 -)

    I use this in button_click on form to write to the sheet

    [vba]Dim dt As Date
    With Sheets("payments")
    dt = Me.Payday.Value
    .Cells(iRow, 3).Value = dt
    End With
    [/vba]
    when formatting
    [VBA]
    Sub test_format()
    Dim dt As Date
    dt = InputBox("Give date - xx/mm/yyyy", "Please give date ...")
    With Sheets(1)
    '(dt, 1) gives long date - weekday number written month and year
    .Cells(ActiveCell.Row, 3).Value = FormatDateTime(dt, 1)
    End With
    End Sub
    [/VBA]
    Charlize
    Last edited by Charlize; 09-29-2006 at 04:46 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •