Automatic Capitalization


Posted by Sandy Dunn on March 15, 2001 5:55 PM

Is there a way to have just one column "automatically capitalize" all text entered in that one column. Example: I have a column that has abbreviations like "LS" (lump sum),and "EA" (each). I don't think "autocorrect" is the right way to handle this one, because it won't be 'column' specific. HELP ME!!!!



Posted by Dave Hawley on March 15, 2001 9:56 PM

Hi Sandy

Your right about auto correct not being the way!
Try this VBA code:


Right click on your sheet name tab and select "View Code" and paste in this over the top of what you see:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Target.Column = 1 Then 'Column A
If Not IsNumeric(Target) Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
End If
End Sub

Change "Column = 1" to the column you want, then push Alt+Q and save.


Dave

OzGrid Business Applications