View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default detect upper and lower case letters

Hi
try
with Activesheet.Range("A1")
if ucase(left(.value,1))=left(.value,1) then
.offset(0,1).value="Upper case"
else
.offset(0,1).value="Lower case"
end if
end with

--
Regards
Frank Kabel
Frankfurt, Germany


mike allen wrote:
i need to tell if the first letter in a text string is capital or
lower case. i have figured out how to do this in the spreadsheet,
but now need it in code. i tried converting my spreadsheet formula
to code, but doesn't work:
If Application.exact(Left(Application.UPPER(Range("A1 ")), 1),
Left(Range("A1"), 1)) = True Then
Range("b1") = "upper case"
Else
Range("b1") = "lower case"
End If
any thoughts? thanks, mike allen