1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: double click for upper case

Discussion in 'Software Development' started by nomad, Dec 4, 2012.

Thread Status:
Not open for further replies.
Advertisement
  1. nomad

    nomad Thread Starter

    Joined:
    Sep 30, 1999
    Messages:
    381
    I would like to double click on any cell from b4 to b100 and it will turn it to upper case as well as double click on any cell from c4 to c100 and make it proper case. Can someone help me out with this:eek:)
     
  2. balloon_tom

    balloon_tom

    Joined:
    Jan 4, 2006
    Messages:
    105
    You might try placing this code into the worksheet code section to see if it helps:

    Code:
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        If Intersect(Target, Range("B4:B100")) Is Nothing Then
        Else
            Range(Target.Address) = UCase(Target)
        End If
        If Intersect(Target, Range("C4:C100")) Is Nothing Then
        Else
            Range(Target.Address) = Application.WorksheetFunction.Proper(Target)
        End If
    End Sub
    
    Tom
     
  3. nomad

    nomad Thread Starter

    Joined:
    Sep 30, 1999
    Messages:
    381
    I used the code above on one of my spread sheets and it works fine. I added another sheet to this workbook and wanted the same code and it doesn't seem to work. I get the following error: "Compile error: Ambiguous name detected: Worksheet_Before DoubleClick". Can you have the same code on different worksheets but the same workbook?
     
  4. balloon_tom

    balloon_tom

    Joined:
    Jan 4, 2006
    Messages:
    105
    I think so. I'm guessing that you copied the sub from the code section of sheet "X" directly to the code section of sheet "Y". That might be the problem. Do this...First, delete this sub from sheet "Y". Then, create a new before_double_ click sub using the drop down declaration box. Finally, copy the code in between the Private Sub... and End Sub, from Sheet "X", and paste in between the same on sheet "Y". Next, I would delete the sub from sheet "X", recreate the sub using the drop down box, and finaly copy the middle code from sheet "Y" back to sheet "X".
    See if that helps.
     
  5. nomad

    nomad Thread Starter

    Joined:
    Sep 30, 1999
    Messages:
    381
    Worked like a charm... thx ballon_tom and everyone else that helped.
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1079560

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice