From: Billns on
On 5/6/2010 8:49 AM, Prashant wrote:
> Hi All,
>
> Need your help!!!
>
> I need a setting/formula/Coding in such a way that whatever text I type in
> sheet 1 it should automatically to be returned in Upper Case i.e. in CAPS.
>
> I checked settings but did not find anything helpful.
>
> Thanks in advance for your assistance!!!
>
> Prashant.

Why not just hit Caps Lock key before you enter the information?
Then hit it again when you're done.

Bill
From: Chip Pearson on
>Private Sub Worksheet_Change(ByVal Target As Range)
> Target.Value = UCase(Target.Value)
>End Sub


You should use Application.EnableEvents to prevent looping:


Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Target.Value = UCase(Target.Value)
Application.EnableEvents = True
End Sub

Without disabling events, changing a cell causes Change to run, which
changes the cell, which causes Change to run, which changes the cell,
which causes Change to run, and on and on until VBA gives up.

EnableEvents = False prevents this looping by indicating to Excel that
it should not trigger any events. EnableEvents = True restores normal
behavior.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]




On Thu, 6 May 2010 09:05:01 -0700, Brad
<Brad(a)discussions.microsoft.com> wrote:

>
>Private Sub Worksheet_Change(ByVal Target As Range)
> Target.Value = UCase(Target.Value)
>End Sub