Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Mar 2003
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Uppercase text (2003)

    Hi All,
    I have a column of data that is formatted as text and contains a mixture of numbers and text in it. Example: 746gfjx7848.
    I am trying to get the text to display in UPPERCASE even if the data is entered in lowercase. I have tried using the UPPER function but either this is not the correct function to use, or I am using it incorrectly.
    Can anyone help?
    Thanks heaps.

    Bill

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Uppercase text (2003)

    If the text you specified is in A1, and I put the formula below in another cell, it displays what I think you are asking for:

    <pre>=UPPER(A1)
    </pre>


    If that does not work for you, could you post a workbook that shows the problem.
    Legare Coleman

  3. #3
    2 Star Lounger
    Join Date
    Mar 2003
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Uppercase text (2003)

    Legare,
    Thanks for your response. That works fine but I have a column of data say F2:F30 and what I am trying to achieve is either have the text display in UPPERcase no matter what case it is entered in as, or find a way of changing the data to UPPERcase after all the data is entered.
    Is this possible?
    Thanks for your help.

    Bill

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Uppercase text (2003)

    If you want to convert the text to uppercase as it is entered, then you could paste the code below into the worksheet change event routine for the worksheet:

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim ocell As Range
    If Intersect(Target, Range("F2:F30")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    For Each ocell In Intersect(Target, Range("F2:F30"))
    ocell.Value = UCase(ocell.Value)
    Next ocell
    Application.EnableEvents = True
    End Sub

    To paste that code into the worksheet change event routine:

    1- Copy the code from above

    2- Right click on the tab for the worksheet and select "View code" from the pop up menu.

    3- Paste the code into the code window.

    Enter something into the range F2:F30 and it should be converted to upper case.
    Legare Coleman

  5. #5
    2 Star Lounger
    Join Date
    Mar 2003
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Uppercase text (2003)

    Bingo!
    Legare - thanks heaps, that got it.
    I appreciate your help.

    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •