+ Reply to Thread
Results 1 to 7 of 7

All Capitals

  1. #1
    Registered User
    Join Date
    06-08-2006
    Location
    Portland, OR
    MS-Off Ver
    Micro Soft XP, Excel 2003
    Posts
    97

    All Capitals

    is there a VB code that will change the case to all Capitals regardless of what is typed in worksheet!!!!

  2. #2
    Michael M
    Guest

    RE: All Capitals

    Hi
    Try using the UPPER function.

    =UPPER(A1) will convert what is in A1 to Upper case

    HTH
    Michael M

    "lostinformulas" wrote:

    >
    > is there a VB code that will change the case to all Capitals regardless
    > of what is typed in worksheet!!!!
    >
    >
    > --
    > lostinformulas
    > ------------------------------------------------------------------------
    > lostinformulas's Profile: http://www.excelforum.com/member.php...o&userid=35229
    > View this thread: http://www.excelforum.com/showthread...hreadid=551668
    >
    >


  3. #3
    Forum Contributor
    Join Date
    06-01-2006
    Posts
    324
    This is from the Microsoft board.

    Becareful you don't have too big of a range.. your workbook will be busy for a long time ...

    Sub Uppercase()

    For Each x In Range("A1:A5")
    x.Value = UCase(x.Value)
    Next

    End Sub
    Google is your best friend!

  4. #4
    Registered User
    Join Date
    06-08-2006
    Location
    Portland, OR
    MS-Off Ver
    Micro Soft XP, Excel 2003
    Posts
    97

    Thumbs up All Capitals

    Thanks,,

    =Upper didn't work due to other condition in the cell


    Bearacada,

    Sub Uppercase()

    worked perfect is there away for it to run automatically.

  5. #5
    Gord Dibben
    Guest

    Re: All Capitals

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    If Target.Column > 8 Then Exit Sub
    On Error GoTo ErrHandler
    Application.EnableEvents = False
    Target.Formula = UCase(Target.Formula)
    ErrHandler:
    Application.EnableEvents = True
    End Sub

    As written, operates on Columns A:H as you enter text in a cell.

    Change the 8 to whatever you wish.

    This is event code and must go into the sheet module.

    Right-click on the sheet tab and "View Code". Copy and paste the above into
    that module.


    Gord Dibben MS Excel MVP

    On Tue, 13 Jun 2006 18:04:41 -0500, lostinformulas
    <[email protected]> wrote:

    >
    >Thanks,,
    >
    >=Upper didn't work due to other condition in the cell
    >
    >
    >Bearacada,
    >
    >Sub Uppercase()
    >
    >worked perfect is there away for it to run automatically.



  6. #6
    Registered User
    Join Date
    06-08-2006
    Location
    Portland, OR
    MS-Off Ver
    Micro Soft XP, Excel 2003
    Posts
    97

    Re: All Capitals

    Gord Dibben

    Thank You for the code it worked great!

  7. #7
    Gord Dibben
    Guest

    Re: All Capitals

    Thanks for the feedback.

    Happy to assist.


    Gord

    On Wed, 14 Jun 2006 10:14:13 -0500, lostinformulas
    <[email protected]> wrote:

    >
    >Gord Dibben
    >
    >Thank You for the code it worked great!


    Gord Dibben MS Excel MVP

+ 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