Force text in cell on worksheet to uppercase

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Hi,
As per title force text in worksheet cell to uppercase.

I have this in worksheet change event but its not doing anything.
I type cash BUT it doesnt change to CASH do you see why.
Thanks

Rich (BB code):
If Intersect(Target, Range("L14:L18")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Value = UCase(Target.Value)
Application.EnableEvents = True
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
It works fine for me.

Note the following things:

1. This only applies to entries in cells L14:L18

2. This code MUST be placed in the Sheet module that you want to run it against, and look something like this:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

If Intersect(Target, Range("L14:L18")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Value = UCase(Target.Value)
Application.EnableEvents = True

End Sub

3. It is possible that in your testing, you disabled events and never re-enabled them, so events would not fire anymore. You can turn them back on by manually running this code:
VBA Code:
Sub ReEnableEvents()
    Application.EnableEvents = True
End Sub

If all those things are true/fixed, it should work. I verified your code works on my computer.
 
Upvote 0
Hi,
Been working fine so the above was just a glitch.

What i had noticed is sometimes when i click the drop down arrow in cell G13 the list shows some customers from the other day.
I am having to click another cell then go back to cell G13 & click drop down arrow to show the correct list values
 
Upvote 0

Forum statistics

Threads
1,215,068
Messages
6,122,950
Members
449,095
Latest member
nmaske

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