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

    Upper Case Input (Excel 2000)

    Is it possible to format cells in such a way that all input, whether upper or lower case, appears as upper case ?

    TQ

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Upper Case Input (Excel 2000)

    No, you can't do that with formatting (as far as I know). You could write code in the Worksheet_Change event: right-click the worksheet, and select View Program Code. Copy the following procedure into the worksheet module:

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim oCell As Range
    On Error GoTo ErrHandler
    Application.EnableEvents = False
    If Not Intersect(Target, Range("A:A")) Is Nothing Then
    For Each oCell In Intersect(Target, Range("A:A"))
    If Not oCell.HasFormula Then
    oCell.Value = UCase(oCell.Value)
    End If
    Next oCell
    End If
    ExitHandler:
    Application.EnableEvents = True
    Set oCell = Nothing
    Exit Sub
    ErrHandler:
    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
    End Sub

    This example works for column A. If you want another range, replace Range("A:A") with the range you want the event procedure to apply to. If you want it to apply to the entire worksheet, use this:

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim oCell As Range
    On Error GoTo ErrHandler
    Application.EnableEvents = False
    For Each oCell In Target
    If Not oCell.HasFormula Then
    oCell.Value = UCase(oCell.Value)
    End If
    Next oCell
    ExitHandler:
    Application.EnableEvents = True
    Set oCell = Nothing
    Exit Sub
    ErrHandler:
    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
    End Sub

  3. #3
    Star Lounger
    Join Date
    Jan 2003
    Location
    Eau Claire, Wisconsin, USA
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Upper Case Input (Excel 2000)

    Hey, Hans!
    I didn't ask the question but I needed the answer! Thanks!

Posting Permissions

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