caps in cells

  • Thread starter Thread starter duckie
  • Start date Start date
D

duckie

how do i always have upper case letters in some cells and not others
when I click on that cell
 
Clicking in a cell will not change the case of the string in a cell.

You could use some double-click event code if that's what you're thinking of.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
If Target.Column > 3 Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
Target.Formula = UCase(Target.Formula)
Cancel = True
ErrHandler:
Application.EnableEvents = True
End Sub


Or you could have the Upper case added as you type in the cell.
No doubleclick involved.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column > 3 Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
Target.Formula = UCase(Target.Formula)
ErrHandler:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top