Thread: Upper Case Woes
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Brian Matlack[_88_] Brian Matlack[_88_] is offline
external usenet poster
 
Posts: 1
Default Upper Case Woes


Hi!

I use the following code to Cause the first (1) letter of an entry i
column C to be Upper case.
Can I modify it to force the first Two (2) characters to be Upper cas
if in fact they are letters? Or do I need a whole new set of code?

<Start Code
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
' Auto change to uppercase first letter
On Error GoTo ErrHandler
If Target.Count = 1 And Target.Column = 3 Then
Application.EnableEvents = False
sStr = Target.Value
Target.Value = UCase(Left(sStr, 1)) & LCase( _
Mid(sStr, 2))
End If
ErrHandler:
Application.EnableEvents = True
End Sub
<End Code

Thanks in advance for any help or suggestions!

--
Brian Matlac
-----------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...nfo&userid=350
View this thread: http://www.excelforum.com/showthread.php?threadid=54560