+ Reply to Thread
Results 1 to 4 of 4

Proper Case not doing letter after a character

Hybrid View

  1. #1
    Registered User
    Join Date
    10-23-2006
    Posts
    79

    Proper Case not doing letter after a character

    Hi

    I am trying to change some text into proper and found an example which I have used from another forum.

    dim PropCells As Range, PropRange As Range....
    Set PropRange = Worksheets("Trans").Range(Cells(1, 1), Cells((Range("a1").End(xlDown).Row), _
                     Range("A1").End(xlToRight).Column))
    Application.EnableEvents = False
      For Each PropCells In PropRange
        PropCells = StrConv(PropCells, vbProperCase)
      Next PropCells
    Application.EnableEvents = True
    It does it great except when there is a word after a character - for example: I would like "(field" to go as "(Field".

    Is there other code (simple code) to add that would sort this part out..?

    I found this link:http://www.excelforum.com/excel-prog...t-working.html but i do not understand what..
    Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    Me.TextBox1.Value = StrConv(Me.TextBox1, vbProperCase)
    End Sub
    ...is doing and I would prefer not to do a separate sub if at all possible.

    dugong

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    The second sub that you posted converts text in a TextBox to Proper Case
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Change
    PropCells = StrConv(PropCells, vbProperCase)
    ... to
    PropCells = WorksheetFunction.Proper(Propcells.Text)
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    10-23-2006
    Posts
    79
    Thanks guys.. I'll try that.

    I may come back if I still have more trouble (with proper) if okay..?

    dugong

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Spellnumber
    By Williams in forum Excel - New Users/Basics
    Replies: 13
    Last Post: 02-16-2020, 03:34 AM
  2. Numbers to Text
    By sachinattri in forum Excel General
    Replies: 6
    Last Post: 06-15-2008, 03:07 AM
  3. "Translating" numbers into words
    By Portuga in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-14-2008, 11:44 AM
  4. Auto change colour of cell when text / letter entered into cell
    By Nik_AU in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-26-2007, 07:36 AM
  5. Spell number
    By nowfal in forum Excel General
    Replies: 4
    Last Post: 08-20-2007, 04:21 PM

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