Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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 t
automatically change those text not in PROPER case as soon as i clic
anywhere on the worksheet...only columns C and D will b
affected...thanks a lot..

--
tweety12
-----------------------------------------------------------------------
tweety127's Profile: http://www.excelforum.com/member.php...fo&userid=3467
View this thread: http://www.excelforum.com/showthread.php?threadid=55100

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default 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" wrote
in message ...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default use of PROPER function in Macros


:) A Big Thanks To All Of You!!! :

--
tweety12
-----------------------------------------------------------------------
tweety127's Profile: http://www.excelforum.com/member.php...fo&userid=3467
View this thread: http://www.excelforum.com/showthread.php?threadid=55100



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help w/ the PROPER function arneson Excel Worksheet Functions 2 August 4th 06 10:22 PM
PROPER function Danielle via OfficeKB.com Excel Worksheet Functions 2 October 14th 05 09:50 PM
How do I use the PROPER function? Lynn in Tulsa Excel Worksheet Functions 6 August 15th 05 07:36 PM
PROPER function MISTY66 Excel Worksheet Functions 1 March 3rd 05 10:16 PM
How do I use the PROPER function? kp Excel Discussion (Misc queries) 3 December 30th 04 01:44 PM


All times are GMT +1. The time now is 03:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"