Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default search for lowercase letter in two-letter 'word'

Hi There,

If I find a second character lowercase letter in a word, I have to
identify the cell Offset(-1,1).
The words are like: Mc, Mv, Np and are all positioned in column C.
Also there, we find words like MK,LP,ET.

haven't found a solution yet,

Regards
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default search for lowercase letter in two-letter 'word'

If I understand your request properly :

Find the ones you need like this

If cells(nRow,nCol).value < UCase(cells(nRow,nCol).value) then

' Your code in here

endif

This will find occurences of lower case characters in your cell values.
--
If the post is helpful, please consider donating something to an animal
charity on my behalf .......... and click Yes


"ppeer" wrote:

Hi There,

If I find a second character lowercase letter in a word, I have to
identify the cell Offset(-1,1).
The words are like: Mc, Mv, Np and are all positioned in column C.
Also there, we find words like MK,LP,ET.

haven't found a solution yet,

Regards
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default search for lowercase letter in two-letter 'word'

This will find a lower case string character when you know what the
character will be:

Sub getshorty()
Dim lr As Long, sh As Worksheet, rng As Range
Dim c As Range
Set sh = ActiveSheet
lr = sh.Cells(Rows.Count, 3).End(xlUp).Row
Set rng = sh.Range("C2:C" & lr)
For Each c In rng
If InStr(1, c.Value, "d", vbBinaryCompare) = 2 Then
Set x = c.Offset(-1, 1)
MsgBox x.Address
End If
Next
End Sub


In this case, "d" was the character being searched.

"ppeer" wrote in message
...
Hi There,

If I find a second character lowercase letter in a word, I have to
identify the cell Offset(-1,1).
The words are like: Mc, Mv, Np and are all positioned in column C.
Also there, we find words like MK,LP,ET.

haven't found a solution yet,

Regards



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default search for lowercase letter in two-letter 'word'

If you only need to find lower case of the second letter and do not know the
character, then this should work.

Sub getshorty()
Dim lr As Long, sh As Worksheet, rng As Range
Dim c As Range
Set sh = ActiveSheet
lr = sh.Cells(Rows.Count, 3).End(xlUp).Row
Set rng = sh.Range("C2:C" & lr)
For Each c In rng
If Not IsEmpty(c) Then
i = Mid(c.Value, 2, 1)
If i = LCase(i) Then
Set x = c.Offset(-1, 1)
MsgBox x.Address
End If
End If
Next
End Sub




"ppeer" wrote in message
...
Hi There,

If I find a second character lowercase letter in a word, I have to
identify the cell Offset(-1,1).
The words are like: Mc, Mv, Np and are all positioned in column C.
Also there, we find words like MK,LP,ET.

haven't found a solution yet,

Regards



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default search for lowercase letter in two-letter 'word'

What you ultimately want to do is not very clear from your posting. For
example... where is this "word" and what action do you envision when you say
"identify"? Perhaps this will help you out... here is a method that tests if
the second character in YourWord (assumed to be a 2-letter word) is lower
case or not...

If YourWord Like "?[a-z]" Then
MsgBox "The second letter of your word is lower case"
Else
MsgBox "The second letter of your word is upper case"
End If

--
Rick (MVP - Excel)


"ppeer" wrote in message
...
Hi There,

If I find a second character lowercase letter in a word, I have to
identify the cell Offset(-1,1).
The words are like: Mc, Mv, Np and are all positioned in column C.
Also there, we find words like MK,LP,ET.

haven't found a solution yet,

Regards


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
Adding a number to a letter of the alphabet to get a letter [email protected] Excel Worksheet Functions 5 May 21st 07 04:25 PM
New Validation option to format 1st letter as Capital letter Jeff Excel Discussion (Misc queries) 5 July 13th 06 05:11 AM
Default Capital letter for 1st letter of a word Jeff Excel Discussion (Misc queries) 6 July 10th 06 08:36 AM
column header changed from letter to number, how return to letter Ron Excel Discussion (Misc queries) 2 May 9th 05 08:34 PM
press letter and go 2 entry begin w letter in data validation drop MCP Excel Programming 1 August 28th 04 05:07 PM


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