#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 47
Default Format Case for only

Hi,
I have names in one column, I need formula to convert the names in to proper
case. but if there is any 3 character word it should be in Upper case.
Plz Help...

eg.
AAA SYSTEM change into AAA system
DELL COMPUTERS change into DELL Computers
MOBILE BPL change into Mobile BPL
SIMMONS LAD change into Simmons LAD
A V SYS MEDIA PVT LTD change into A V SYS Media PVT LTD

It should change the case to upper for 3 letter words and rest to Proper case
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Format Case for only

Select a cell and then run this macro:

Sub Deepak()
Dim r As Range
Dim s As String, sOut As String

Set r = Selection
r.Value = WorksheetFunction.Proper(r.Value)
s = r.Value
ss = Split(s, " ")

For i = LBound(ss) To UBound(ss)
If Len(ss(i)) = 3 Then
ss(i) = UCase(ss(i))
End If
Next

sOut = ss(0)

For i = LBound(ss) + 1 To UBound(ss)
sOut = sOut & " " & ss(i)
Next

r.Value = sOut
End Sub

--
Gary''s Student


"Deepak" wrote:

Hi,
I have names in one column, I need formula to convert the names in to proper
case. but if there is any 3 character word it should be in Upper case.
Plz Help...

eg.
AAA SYSTEM change into AAA system
DELL COMPUTERS change into DELL Computers
MOBILE BPL change into Mobile BPL
SIMMONS LAD change into Simmons LAD
A V SYS MEDIA PVT LTD change into A V SYS Media PVT LTD

It should change the case to upper for 3 letter words and rest to Proper case

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
Displays the number in text. (One thousand two hundred thirty four Ashish Patel Excel Worksheet Functions 1 March 20th 06 09:27 PM
how to use spellnumber formula Aarif Excel Worksheet Functions 3 February 27th 06 04:36 PM
Currency to Text mytipi Excel Worksheet Functions 1 February 21st 06 11:43 PM
VBA Code Cell Mate Excel Discussion (Misc queries) 4 January 9th 06 08:52 PM
EXCEL:NUMBER TO GREEK WORDS vag Excel Worksheet Functions 1 June 15th 05 05:57 PM


All times are GMT +1. The time now is 05:48 PM.

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

About Us

"It's about Microsoft Excel"