Results 1 to 4 of 4

Forcing UK date format in Date command

Threaded View

  1. #1
    Forum Contributor
    Join Date
    11-13-2007
    Location
    Petersfield, Hampshire, UK
    MS-Off Ver
    MS Office for Mac ver 16
    Posts
    135

    Forcing UK date format in Date command

    I have the code below working as I want it to, when data is input in column 2 the date and time is automatically input into the corresponding cell 3 columns to the right. I want to ensure that the date is changed to the UK format dd-mmm-yy. I have formatted the column to be in that format but for some reason it has suddenly started changing the date to US format.

    Can this code be changed to force the date to be in UK format?

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
        With Target
            If .Column = 3 And .Offset(0, 3).Locked = False Then
                ActiveSheet.Unprotect "test"
                ActiveSheet.Unprotect
                .Offset(0, 3).Value = Date & " " & Time
                .Offset(0, 3).Locked = True
                ActiveSheet.Protect "test"
            End If
        End With
    End Sub
    Regards

    Geoff
    Last edited by Glio; 11-05-2008 at 05:14 AM.
    Geoff Culbertson
    Petersfield, UK

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