Results 1 to 4 of 4

Enforcing Upper case

Threaded View

  1. #1
    Registered User
    Join Date
    02-05-2008
    Posts
    54

    Arrow Enforcing Upper case

    Hi
    Im using the code below to enforce user input to be in upper case.

    Private Sub Worksheet_Change(ByVal Target As Range)
        Dim r As Range
        If Target.Count > 1 Then Exit Sub
        If Not Application.Intersect(Target, Range("A1:A20")) Is Nothing Then
            Application.EnableEvents = False
            With Target
                .Value = UCase(.Value)
            End With
            Application.EnableEvents = True
        End If
    End Sub
    This works fine for Col A - or indeed over multiple cols using Target Range (“A1:G20”)) etc.

    My issue now is, Id like to have the upper case enforcement on specified cols, eg ONLY cols A, F, L, R , W. All other input into the intervening cols is to be standard Upper/lower case.

    Can anyone suggest a way this might be done?

    Many Thanks
    Last edited by Shytott; 08-20-2011 at 11:30 AM. Reason: Requested to add code tags by moderator.

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