Simple or Not?

August

Active Member
Joined
Jun 18, 2004
Messages
270
Can a cell be formatted so that whaterver text is typed in it is in Capitals, ideally this would be in a protected worksheet

Thanks
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
don't know about formatting but I am sure it could be done with a macro in the workbook_change event. What range of cells do you want the formatting to apply to?
 
Upvote 0
Hi,

You cannot format a cell like that.

Try this code in the code module for the sheet in question.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("A1").Address Then Target = UCase(Target.Text)
End Sub
 
Upvote 0
fairwinds

Just for my academic interest - why this cant be done through data>validation>custom>formula ...

Regards
Asim
 
Upvote 0
Hi masim.

You can use data validation to force a user to enter in upper case, but not to alter lowercase to uppercase.
 
Upvote 0
fairwinds said:
Hi,

You cannot format a cell like that.

Try this code in the code module for the sheet in question.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("A1").Address Then Target = UCase(Target.Text)
End Sub


Thank you....perfect as always
 
Upvote 0
August said:
fairwinds said:
Hi,

You cannot format a cell like that.

Try this code in the code module for the sheet in question.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("A1").Address Then Target = UCase(Target.Text)
End Sub


Thank you....perfect as always


I've tried applying the code to get "Proper Case" for range of cells in another worksheet. I put the codee in Worksheet and changed it as follows:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("A:A").Address Then Target = Proper(Target.Text)
End Sub


But it doesn't work for me.........where am I going wrong

Thanks
 
Upvote 0
Try:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Set isect = Application.Intersect(Target, Range("A:A"))
If Not isect Is Nothing Then
Target = WorksheetFunction.Proper(Target.Text)
End If
Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,524
Messages
6,114,117
Members
448,549
Latest member
brianhfield

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