Auto Formatting a cell to change text to all CAPS.

Eric Livesay

Board Regular
Joined
Feb 13, 2008
Messages
127
How can I format a cell to automatically change any entered text to all capital letters?

Thanks, Eric.
 
Sounds like you're file isn't macro-enabled. From the Save As Dialogue, choose the file type that ends with "xlsm"
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Thanks for the reply! Okay so now it says:
Private Sub Worksheet_Change (ByVal Target As Range)
On Error GoTo 0
If Target.HasFormula = False And Target.Count = 1 Then Target.Value = UCase (Target.Value)
End Sub


Is this correct to save and put into place??
 
Upvote 0
OK, 3rd time lucky. This code tests whether the target cell contains a formula. It also tests that only one cell is selected.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    On Error GoTo 0
    If Target.HasFormula = False And Target.Count = 1 Then Target.Value = UCase(Target.Value)
End Sub


I keep getting that debug error whenever I go from a cell that was blank but I had input, press enter then end up in a cell that already had text. Is there a way you can add to this code to ignore cells that already have data?

This script is wonderfully useful. Thank you for it.
 
Upvote 0
I've tried using the code provided, but after a few cell entries, it kicks me out without saving. I just want to apply this to a columns in 5 separate tables. Is this possible?
 
Upvote 0

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top