+ Reply to Thread
Results 1 to 5 of 5

use of PROPER function in Macros

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-22-2006
    Posts
    103

    Arrow use of PROPER function in Macros

    hi experts....

    i just want to ask....

    how can i use the PROPER function in macros?....because i want to automatically change those text not in PROPER case as soon as i click anywhere on the worksheet...only columns C and D will be affected...thanks a lot...

  2. #2
    Paul Mathews
    Guest

    RE: use of PROPER function in Macros

    Application.WorksheetFunction.Proper(Put string variable here)

    "tweety127" wrote:

    >
    > hi experts....
    >
    > i just want to ask....
    >
    > how can i use the PROPER function in macros?....because i want to
    > automatically change those text not in PROPER case as soon as i click
    > anywhere on the worksheet...only columns C and D will be
    > affected...thanks a lot...
    >
    >
    > --
    > tweety127
    > ------------------------------------------------------------------------
    > tweety127's Profile: http://www.excelforum.com/member.php...o&userid=34673
    > View this thread: http://www.excelforum.com/showthread...hreadid=551002
    >
    >


  3. #3
    Tom Ogilvy
    Guest

    RE: use of PROPER function in Macros

    sub ConvertString()
    Dim cell as Range, rng as range
    On Error Resume Next
    set rng = selection.SpecialCells(xlconstants,xlTextValues)
    On Error goto 0
    if not rng is nothing then
    for each cell in rng
    cell.value = strconv(cell.value,vbProperCase)
    Next
    End if
    end sub

    --
    Regards,
    Tom Ogilvy


    "tweety127" wrote:

    >
    > hi experts....
    >
    > i just want to ask....
    >
    > how can i use the PROPER function in macros?....because i want to
    > automatically change those text not in PROPER case as soon as i click
    > anywhere on the worksheet...only columns C and D will be
    > affected...thanks a lot...
    >
    >
    > --
    > tweety127
    > ------------------------------------------------------------------------
    > tweety127's Profile: http://www.excelforum.com/member.php...o&userid=34673
    > View this thread: http://www.excelforum.com/showthread...hreadid=551002
    >
    >


  4. #4
    Bob Phillips
    Guest

    Re: use of PROPER function in Macros

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    On Error GoTo ws_exit
    Application.EnableEvents = False
    With Target
    If .Column = 3 Or .Column = 4 Then
    .Value = Application.Proper(.Value)
    End If
    End With

    ws_exit:
    Application.EnableEvents = True
    On Error GoTo 0
    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

    (replace xxxx in the email address with gmail if mailing direct)

    "tweety127" <tweety127.29aktc_1150120204.9928@excelforum-nospam.com> wrote
    in message news:tweety127.29aktc_1150120204.9928@excelforum-nospam.com...
    >
    > hi experts....
    >
    > i just want to ask....
    >
    > how can i use the PROPER function in macros?....because i want to
    > automatically change those text not in PROPER case as soon as i click
    > anywhere on the worksheet...only columns C and D will be
    > affected...thanks a lot...
    >
    >
    > --
    > tweety127
    > ------------------------------------------------------------------------
    > tweety127's Profile:

    http://www.excelforum.com/member.php...o&userid=34673
    > View this thread: http://www.excelforum.com/showthread...hreadid=551002
    >




  5. #5
    Forum Contributor
    Join Date
    05-22-2006
    Posts
    103

    Thumbs up

    A Big Thanks To All Of You!!!

+ 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