Results 1 to 6 of 6

Vba date formatting

Threaded View

  1. #1
    Registered User
    Join Date
    07-18-2009
    Location
    MODESTO,USA
    MS-Off Ver
    Excel 2007
    Posts
    53

    Vba date formatting

    Hello, how do I change the format inthe following code so it appears as:

    Name of the day, Name of the Month - Day Number, Year

    exemple: Thursday, June 17, 2010

    I have the following code:

    Private Sub Calendar1_Click()
        ActiveCell.Value = CDbl(Calendar1.Value)
        ActiveCell.NumberFormat = "mm/dd/yyyy"
        ActiveCell.Select
        Calendar1.Visible = False
    End Sub
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        If Target.Cells.Count > 1 Then Exit Sub
        If Not Application.Intersect(Range("H4:H4"), Target) Is Nothing Then
            Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
            Calendar1.Top = Target.Top + Target.Height
            Calendar1.Visible = True
            ' select Today's date in the Calendar
            Calendar1.Value = Date
        ElseIf Calendar1.Visible Then Calendar1.Visible = False
        End If
    End Sub
    Last edited by CESAR V. ARROYO; 06-18-2010 at 06:58 PM.

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