Results 1 to 2 of 2

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Threaded View

  1. #1
    Registered User
    Join Date
    02-28-2011
    Location
    China
    MS-Off Ver
    Excel 2007
    Posts
    1

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    Good day,
    Will like to use these 2 codes in the work sheet. It gives ambigous error in the 2nd code 1st line - Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Kindly suggest what to write in tht line or how to use these 2 codes together.

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        
        'another method is to have it show if a cell that is formatted as a date is selected...see below
        If Target.NumberFormat = "m/d/yy;@" Then
            CalendarFrm.Show
        End If
          
        'another method is using Select Case...see below
        Select Case Target.NumberFormat
            Case Is = "m/d/yy", "m/d/yyyy", "m/d/yy", "mm/dd/yy", "yyyy-mmm-dd", "dd-mmm-yy"
            CalendarFrm.Show
            'Case Else
            '    MsgBox "Not a valid date format!"
        End Select
    End Sub
    ......................................................................................................................
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Me.ScrollArea = "A1:AX252"
    
    End Sub
    Thanks in advance
    whitesapphire24
    Attached Files Attached Files
    Last edited by Leith Ross; 02-28-2011 at 03:41 AM. Reason: Added Code Tags

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