Results 1 to 7 of 7

BeforeDoubleClick Multiple Ranges

Threaded View

ckk403 BeforeDoubleClick Multiple... 06-11-2012, 10:57 AM
mikerickson Re: BeforeDoubleClick... 06-11-2012, 11:01 AM
ckk403 Re: BeforeDoubleClick... 06-11-2012, 11:04 AM
shg Re: BeforeDoubleClick... 06-11-2012, 11:06 AM
ckk403 Re: BeforeDoubleClick... 06-11-2012, 11:08 AM
shg Re: BeforeDoubleClick... 06-11-2012, 11:14 AM
ckk403 Re: BeforeDoubleClick... 06-11-2012, 11:16 AM
  1. #1
    Registered User
    Join Date
    12-29-2010
    Location
    USA
    MS-Off Ver
    Excel 2003/2010
    Posts
    69

    Unhappy BeforeDoubleClick Multiple Ranges

    Hello previously someone on here helped me with the following.
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    
    If Target.Count > 1 Or Intersect(Target, Range("D4:D9")) Is Nothing Then Exit Sub
        Select Case Target.Value
            Case Is = ""
                Target.Font.Name = "Wingdings"
                Target.Font.Size = "24"
                Target.Value = "ü"
            Case Is = "ü"
              Target.Font.Size = "28"
                Target.Value = "û"
            Case Is = "û"
                Target.ClearContents
        End Select
        Cancel = True
    End Sub
    However now I need to add the below to it.

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    
    If Target.Count > 1 Or Intersect(Target, Range("D10:D40")) Is Nothing Then Exit Sub
        Select Case Target.Value
            Case Is = ""
                Target.Font.Name = "Wingdings"
                Target.Font.Size = "24"
                Target.Value = "ü"
            Case Is = "ü"
              Target.Font.Size = "28"
                Target.Value = "û"
            Case Is = "û"
                Target.Font.Name = "Calibro"
                Target.Font.Size = "8"
                Target.Value = "N/A"
            Case Is = "N/A"
                Target.ClearContents
        End Select
        Cancel = True
    End Sub
    So the first range D4:D9 cycles through check, x, blank. The second range D10:D40 cycles through check, x, N/A, blank. I just don't know how to combine them.
    Last edited by ckk403; 06-11-2012 at 11:09 AM. Reason: Solved

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