Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding a number to a letter of the alphabet to get a letter | Excel Worksheet Functions | |||
New Validation option to format 1st letter as Capital letter | Excel Discussion (Misc queries) | |||
Default Capital letter for 1st letter of a word | Excel Discussion (Misc queries) | |||
column header changed from letter to number, how return to letter | Excel Discussion (Misc queries) | |||
press letter and go 2 entry begin w letter in data validation drop | Excel Programming |