hi
new to excel building so please bare with me. is there any way to format a
worksheet so that any data entered is automatically converted to upper case?
hi
new to excel building so please bare with me. is there any way to format a
worksheet so that any data entered is automatically converted to upper case?
Not by formatting, but you can add event code behind it
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
Target.Value = UCase(Target.Value)
ws_exit:
Application.EnableEvents = True
End Sub
'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.
--
HTH
Bob Phillips
"Beginner2005" <[email protected]> wrote in message
news:[email protected]...
> hi
> new to excel building so please bare with me. is there any way to format a
> worksheet so that any data entered is automatically converted to upper
case?
"Bob Phillips" wrote:
> Not by formatting, but you can add event code behind it
>
> Private Sub Worksheet_Change(ByVal Target As Range)
>
> On Error GoTo ws_exit:
> Application.EnableEvents = False
> Target.Value = UCase(Target.Value)
>
> ws_exit:
> Application.EnableEvents = True
> End Sub
>
> 'This is worksheet event code, which means that it needs to be
> 'placed in the appropriate worksheet code module, not a standard
> 'code module. To do this, right-click on the sheet tab, select
> 'the View Code option from the menu, and paste the code in.
>
>
>
>
> --
> HTH
>
> Bob Phillips
>
> "Beginner2005" <[email protected]> wrote in message
> news:[email protected]...
> > hi
> > new to excel building so please bare with me. is there any way to format a
> > worksheet so that any data entered is automatically converted to upper
> case?
>
>
>
Hi Bob
thanks for the help, quick question, is there any way to modify this code to
exclude a specific column i.e column 'C'?
"Bob Phillips" wrote:
> Not by formatting, but you can add event code behind it
>
> Private Sub Worksheet_Change(ByVal Target As Range)
>
> On Error GoTo ws_exit:
> Application.EnableEvents = False
> Target.Value = UCase(Target.Value)
>
> ws_exit:
> Application.EnableEvents = True
> End Sub
>
> 'This is worksheet event code, which means that it needs to be
> 'placed in the appropriate worksheet code module, not a standard
> 'code module. To do this, right-click on the sheet tab, select
> 'the View Code option from the menu, and paste the code in.
>
>
>
>
> --
> HTH
>
> Bob Phillips
>
> "Beginner2005" <[email protected]> wrote in message
> news:[email protected]...
> > hi
> > new to excel building so please bare with me. is there any way to format a
> > worksheet so that any data entered is automatically converted to upper
> case?
>
>
>
Yeah, not hard.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
With Target
If .Column <> 3 Then
.Value = UCase(.Value)
End If
End With
ws_exit:
Application.EnableEvents = True
End Sub
--
HTH
Bob Phillips
"Beginner2005" <[email protected]> wrote in message
news:[email protected]...
> Hi Bob
> thanks for the help, quick question, is there any way to modify this code
to
> exclude a specific column i.e column 'C'?
>
> "Bob Phillips" wrote:
>
> > Not by formatting, but you can add event code behind it
> >
> > Private Sub Worksheet_Change(ByVal Target As Range)
> >
> > On Error GoTo ws_exit:
> > Application.EnableEvents = False
> > Target.Value = UCase(Target.Value)
> >
> > ws_exit:
> > Application.EnableEvents = True
> > End Sub
> >
> > 'This is worksheet event code, which means that it needs to be
> > 'placed in the appropriate worksheet code module, not a standard
> > 'code module. To do this, right-click on the sheet tab, select
> > 'the View Code option from the menu, and paste the code in.
> >
> >
> >
> >
> > --
> > HTH
> >
> > Bob Phillips
> >
> > "Beginner2005" <[email protected]> wrote in message
> > news:[email protected]...
> > > hi
> > > new to excel building so please bare with me. is there any way to
format a
> > > worksheet so that any data entered is automatically converted to upper
> > case?
> >
> >
> >
A slight variation, so that formulas don't get wiped
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
With Target
If .Column <> 3 Then
If Not .HasFormula Then
.Value = UCase(.Value)
End If
End If
End With
ws_exit:
Application.EnableEvents = True
End Sub
--
HTH
Bob Phillips
"Beginner2005" <[email protected]> wrote in message
news:[email protected]...
> Hi Bob
> thanks for the help, quick question, is there any way to modify this code
to
> exclude a specific column i.e column 'C'?
>
> "Bob Phillips" wrote:
>
> > Not by formatting, but you can add event code behind it
> >
> > Private Sub Worksheet_Change(ByVal Target As Range)
> >
> > On Error GoTo ws_exit:
> > Application.EnableEvents = False
> > Target.Value = UCase(Target.Value)
> >
> > ws_exit:
> > Application.EnableEvents = True
> > End Sub
> >
> > 'This is worksheet event code, which means that it needs to be
> > 'placed in the appropriate worksheet code module, not a standard
> > 'code module. To do this, right-click on the sheet tab, select
> > 'the View Code option from the menu, and paste the code in.
> >
> >
> >
> >
> > --
> > HTH
> >
> > Bob Phillips
> >
> > "Beginner2005" <[email protected]> wrote in message
> > news:[email protected]...
> > > hi
> > > new to excel building so please bare with me. is there any way to
format a
> > > worksheet so that any data entered is automatically converted to upper
> > case?
> >
> >
> >
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks