![]() |
Auto change font to 'capital letters'
Hi,
is it possible to change data entered into any cell so that it appears as CAPITAL LETTERS without actualy placing a formula (=UPPER(A2) into each cell. I want this to apply to the whole worksheet. thanks |
Right-click the worksheet tab, select View Code, and
insert the code below: Private Sub Worksheet_Change(ByVal Target As Excel.Range) Application.EnableEvents = False With Target If .Count = 1 Then .Value = UCase(.Value) End If End With Application.EnableEvents = True End Sub --- Press ALT+Q to close and return to XL. HTH Jason Atlanta, GA -----Original Message----- Hi, is it possible to change data entered into any cell so that it appears as CAPITAL LETTERS without actualy placing a formula (=UPPER (A2) into each cell. I want this to apply to the whole worksheet. thanks . |
Jason
,thanks for your help , I had to adjust it a little but it works fine, regards Anthony "Jason Morin" wrote: Right-click the worksheet tab, select View Code, and insert the code below: Private Sub Worksheet_Change(ByVal Target As Excel.Range) Application.EnableEvents = False With Target If .Count = 1 Then .Value = UCase(.Value) End If End With Application.EnableEvents = True End Sub --- Press ALT+Q to close and return to XL. HTH Jason Atlanta, GA -----Original Message----- Hi, is it possible to change data entered into any cell so that it appears as CAPITAL LETTERS without actualy placing a formula (=UPPER (A2) into each cell. I want this to apply to the whole worksheet. thanks . |
Is there any chance you will enter any formulas on this page at all? If so
then you need to catch those and not convert them else you will lose the formulas as soon as you hit ENTER, so with a slight addition to Jason's code Private Sub Worksheet_Change(ByVal Target As Excel.Range) Application.EnableEvents = False With Target If .Count = 1 And .HasFormula = False Then .Value = UCase(.Value) End If End With Application.EnableEvents = True End Sub -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 97/00/02/03 ---------------------------------------------------------------------------- It's easier to beg forgiveness than ask permission :-) ---------------------------------------------------------------------------- "Anthony" wrote in message ... Jason ,thanks for your help , I had to adjust it a little but it works fine, regards Anthony "Jason Morin" wrote: Right-click the worksheet tab, select View Code, and insert the code below: Private Sub Worksheet_Change(ByVal Target As Excel.Range) Application.EnableEvents = False With Target If .Count = 1 Then .Value = UCase(.Value) End If End With Application.EnableEvents = True End Sub --- Press ALT+Q to close and return to XL. HTH Jason Atlanta, GA -----Original Message----- Hi, is it possible to change data entered into any cell so that it appears as CAPITAL LETTERS without actualy placing a formula (=UPPER (A2) into each cell. I want this to apply to the whole worksheet. thanks . |
All times are GMT +1. The time now is 06:41 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com