+ Reply to Thread
Results 1 to 11 of 11

Upper case

  1. #1
    Bob Phillips
    Guest

    Re: 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?



  2. #2
    Beginner2005
    Guest

    Re: 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?
    >
    >
    >


  3. #3
    Beginner2005
    Guest

    Re: 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?
    >
    >
    >


  4. #4
    Bob Phillips
    Guest

    Re: 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?
    > >
    > >
    > >




  5. #5
    Bob Phillips
    Guest

    Re: 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?
    > >
    > >
    > >




  6. #6
    Beginner2005
    Guest

    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?

  7. #7
    Bob Phillips
    Guest

    Re: 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?



  8. #8
    Beginner2005
    Guest

    Re: 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?
    >
    >
    >


  9. #9
    Beginner2005
    Guest

    Re: 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?
    >
    >
    >


  10. #10
    Bob Phillips
    Guest

    Re: 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?
    > >
    > >
    > >




  11. #11
    Bob Phillips
    Guest

    Re: 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?
    > >
    > >
    > >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1