Consulting

Results 1 to 5 of 5

Thread: Convert a range to Proper Case

  1. #1
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,064
    Location

    Convert a range to Proper Case

    Is there a way to convert the contents of a range to proper case without using vba?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  2. #2
    Yeah, ... =Proper(OldText) then Copy, Paste Values
    It's not quick, it's not pretty but thare are no macros !!!
    2+2=9 ... (My Arithmetic Is Mental)

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Agreed, not without VBA, but you can fix it as you go with a worksheet event (also posted in the other thread)
    [VBA]Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
    With Target
    If .Column = 2 Then
    .Value = WorksheetFunction.Proper(.Value)
    .Replace "'S", "'s"
    End If
    End With
    Application.EnableEvents = True
    End Sub

    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  4. #4
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,064
    Location
    And if the range already exists ( 1850 rows)?

    Can a conditional format do the trick?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  5. #5
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Quote Originally Posted by Aussiebear
    Can a conditional format do the trick?
    I don't see how.
    You could also use a Selection Change event, and keep pressing the Down Arrow.
    [VBA]Option Explicit

    Private Sub Worksheet_Change(ByVal Target As Range)
    Proper Target
    End Sub

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Proper Target
    End Sub

    Sub Proper(Target As Range)
    Application.EnableEvents = False
    With Target
    If .Column = 2 Then
    .Value = WorksheetFunction.Proper(.Value)
    .Replace "'S", "'s"
    End If
    End With
    Application.EnableEvents = True
    End Sub

    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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