LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 32
Default TRIM function

I can't get this to work! Probably me. Where do I put it?
--
tia


"Sheeloo" wrote:

Try this UDF (sorry, may not fit on a postcard :-)
'USAGE enter into any cell as =extractCAPS(A1) if your string is in A1
Function extractCAPS(iStr As String) As String
extractCAPS = ""
Dim c As String
Dim iWord As String
iWord = ""
Dim i As Integer
If Len(iStr) = 0 Then
extractCAPS = ""
Exit Function
End If
For i = 1 To Len(iStr)
c = Mid(iStr, i, 1)
If c < " " Then
iWord = iWord & c
Else
If (iWord = StrConv(iWord, vbUpperCase)) Then
extractCAPS = extractCAPS & iWord
End If
iWord = " "
End If
Next i
If (iWord = StrConv(iWord, vbUpperCase)) Then
extractCAPS = extractCAPS & iWord
End If
End Function
--
If you find this post helpful pl. choose "Yes"...


"JockW" wrote:

Hi
Is it possible to use a function to extract only words in capital letters in
a cell?
So, for instance from "IS IT POSSIBLE to use a function" would return IS IT
POSSIBLE and ignore the rest.

Answers on a postcard please....
--
tia

 
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
TRIM FUNCTION...how to? Shayra Excel Worksheet Functions 3 March 10th 08 06:39 PM
Trim Function Saxman[_2_] Excel Discussion (Misc queries) 7 August 2nd 07 01:20 AM
TRIM function fitou_learn[_2_] New Users to Excel 2 June 12th 07 11:06 AM
Trim Function Matt M HMS Excel Worksheet Functions 5 November 21st 05 10:46 PM
Need help with TRIM function Phil Excel Worksheet Functions 9 October 21st 05 08:02 PM


All times are GMT +1. The time now is 08:17 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"