Consulting

Results 1 to 3 of 3

Thread: Solved: Change Date Format VBA

  1. #1
    VBAX Contributor
    Joined
    Dec 2006
    Posts
    193
    Location

    Solved: Change Date Format VBA

    The following code paste,s the current date into a cell:

    [VBA]
    Set WsTgt = Workbooks("Gardens History.xls").Sheets(1)
    With WsTgt.Range("A" & NextEmptyRow(WsTgt))
    .Value = Date
    [/VBA]

    The pasted cell shows to day for instance as being (quite correctly ) 2007/11/22

    Is it possible to change the code so the pasted cell shows

    THURS 22 NOV 07

    THANKS FOR ANY HELP

  2. #2
    Try both numberformat options, maybe one of them will be OK.

    [vba]Set WsTgt = Workbooks("Gardens History.xls").Sheets(1)
    With WsTgt.Range("A" & NextEmptyRow(WsTgt))
    .Value = Date
    .NumberFormat = "dddd dd mmm yy"
    .NumberFormat = "ddd dd mmm yy"[/vba]

    Jimmy
    -------------------------------------------------
    The more details you give, the easier it is to understand your question. Don't save the effort, tell us twice rather than not at all. The amount of info you give strongly influences the quality of answer, and also how fast you get it.

  3. #3
    VBAX Contributor
    Joined
    Dec 2006
    Posts
    193
    Location
    BOTH WORKED THANK YOU

Posting Permissions

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