+ Reply to Thread
Results 1 to 4 of 4

Dateformat

  1. #1
    Kjeldc
    Guest

    Dateformat


    This just returns the daynumber, not the formati wish. Why oh Why. Please
    help
    With ActiveCell
    .Value = "*"
    .Offset(0, 1).Value = DTPicker1
    ActiveCell.NumberFormat = "dd-mm-yyyy"
    .Offset(0, 3).Value = Val(txtMember)
    End With

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Kjeldc,

    This should work for you.

    With ActiveCell
    .Value = "*"
    .Offset(0, 1).Value = DTPicker1
    .Value = Format(.Value, "dd-mm-yyyy")
    .Offset(0, 3).Value = Val(txtMember)
    End With


    Hope this helps,
    Leith Ross

  3. #3
    Tom Ogilvy
    Guest

    Re: Dateformat

    don't you want to format the cell containing the date?

    With ActiveCell
    .Value = "*"
    .Offset(0, 1).Value = DTPicker1
    .Offset(0,1).NumberFormat = "dd-mm-yyyy"
    .Offset(0, 3).Value = Val(txtMember)
    End With

    --
    Regards,
    Tom Ogilvy


    "Kjeldc" <[email protected]> wrote in message
    news:[email protected]...
    >
    > This just returns the daynumber, not the formati wish. Why oh Why. Please
    > help
    > With ActiveCell
    > .Value = "*"
    > .Offset(0, 1).Value = DTPicker1
    > ActiveCell.NumberFormat = "dd-mm-yyyy"
    > .Offset(0, 3).Value = Val(txtMember)
    > End With




  4. #4
    Kjeldc
    Guest

    Re: Dateformat

    Thanks a lot. Somehow I had the idea, that .offset(0,1) WAS the activecell.

    "Tom Ogilvy" skrev:

    > don't you want to format the cell containing the date?
    >
    > With ActiveCell
    > .Value = "*"
    > .Offset(0, 1).Value = DTPicker1
    > .Offset(0,1).NumberFormat = "dd-mm-yyyy"
    > .Offset(0, 3).Value = Val(txtMember)
    > End With
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Kjeldc" <[email protected]> wrote in message
    > news:[email protected]...
    > >
    > > This just returns the daynumber, not the formati wish. Why oh Why. Please
    > > help
    > > With ActiveCell
    > > .Value = "*"
    > > .Offset(0, 1).Value = DTPicker1
    > > ActiveCell.NumberFormat = "dd-mm-yyyy"
    > > .Offset(0, 3).Value = Val(txtMember)
    > > End With

    >
    >
    >


+ Reply to Thread

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