Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 93
Default Check for case of string

So as I work with this VBA from coder I see you can set case of string

Is there anyway to examine case? Either If All Uppercase or if Mixed/Init
Caps is fine either way I can continue my logic.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Check for case of string

Check your other post.

msnyc07 wrote:

So as I work with this VBA from coder I see you can set case of string

Is there anyway to examine case? Either If All Uppercase or if Mixed/Init
Caps is fine either way I can continue my logic.

Thanks!


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Check for case of string

On Wed, 17 Feb 2010 15:08:01 -0800, msnyc07
wrote:

So as I work with this VBA from coder I see you can set case of string

Is there anyway to examine case? Either If All Uppercase or if Mixed/Init
Caps is fine either way I can continue my logic.

Thanks!


First letter Cap:

Dim s as String
Left(s, 1) Like "[A-Z]"

That might cover everything you need.

If you need to be sure that if the first letter is capitalized, the rest are
either ALL caps or ALL non-caps, then perhaps:

Dim s as String
Left(s, 1) Like "[A-Z]" And _
(Mid(s, 2) = UCase(Mid(s, 2)) Or Mid(s, 2) = LCase(Mid(s, 2)))
--ron
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Check for case of string

Hi,

Try this

If mystring = UCase(mystring) Then
MsgBox "all uppercase"
Else
MsgBox "Mixed case"
End If

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"msnyc07" wrote:

So as I work with this VBA from coder I see you can set case of string

Is there anyway to examine case? Either If All Uppercase or if Mixed/Init
Caps is fine either way I can continue my logic.

Thanks!

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
Check for NON-presence of a string in another string G.P.N.L. c.v.a. Excel Worksheet Functions 4 December 11th 09 06:10 PM
Check if variable contains a string Ted M H Excel Worksheet Functions 5 December 22nd 08 03:58 PM
Check for character in string dksaluki Excel Discussion (Misc queries) 3 December 11th 07 12:53 PM
use of vlookup in case of multiple column check Bharat Saboo Excel Worksheet Functions 1 December 31st 05 04:12 PM
Excel VBA - Check/Format String magix Excel Discussion (Misc queries) 1 November 6th 05 11:02 AM


All times are GMT +1. The time now is 10:43 AM.

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"