Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default case of the data

Is it possible to check the case of a string i.e. if its in lower or upper case
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default case of the data

Phil,

Here's a code-friendly way:

Option Explicit
Option Private Module

Public Enum vbCase
vbMixedCase = 0
vbLowerCase = 1
vbUpperCase = 2
End Enum

Public Function GetCase(strTest As String) As vbCase
GetCase = -((LCase(strTest) = strTest) * vbLowerCase + _
(UCase(strTest) = strTest) * vbUpperCase)
End Function

Sub Test()
MsgBox GetCase("Robin") = vbUpperCase
MsgBox GetCase("Robin") = vbLowerCase
MsgBox GetCase("Robin") = vbMixedCase
End Sub

Robin Hammond
www.enhanceddatasystems.com

"phil" wrote in message
...
Is it possible to check the case of a string i.e. if its in lower or upper
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
change data of entire column from small case to upper case Ann Excel Worksheet Functions 1 August 16th 08 01:06 PM
Changing multiple cell text from lower case to upper case Patti Excel Discussion (Misc queries) 2 January 4th 08 08:35 PM
How to change mixed case to upper case in Excel for all cells WordAlone Network Excel Discussion (Misc queries) 7 May 30th 07 05:53 AM
Change the text from lower case to upper case in an Excel work boo dave01968 Excel Discussion (Misc queries) 2 December 9th 05 09:09 AM
How to use formula auditing to change upper case to Title Case. ScoobeyDoo Excel Worksheet Functions 1 November 19th 04 06:26 PM


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