View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Search for Upper Case

Maybe you could use a macro to select the cells that have any uppercase
characters:

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim TempWks As Worksheet
Dim UpperCaseAddr As String

Application.ScreenUpdating = False

Set wks = Worksheets("Sheet1")
Set TempWks = Worksheets.Add

With wks
TempWks.Range(.UsedRange.Address).FormulaR1C1 _
= "=exact('" & .Name & "'!RC,lower('" & .Name & "'!RC))"
End With

With TempWks.Range(wks.UsedRange.Address)
.FormulaR1C1 _
= "=exact('" & wks.Name & "'!RC,lower('" & wks.Name & "'!RC))"
.Value = .Value
.Replace what:=True, _
replacement:="", _
lookat:=xlWhole, _
searchorder:=xlByRows, _
MatchCase:=False

UpperCaseAddr = ""
On Error Resume Next
UpperCaseAddr = .Cells.SpecialCells(xlCellTypeConstants).Address
On Error GoTo 0

End With

Application.DisplayAlerts = False
TempWks.Delete
Application.DisplayAlerts = True

Application.ScreenUpdating = True

If UpperCaseAddr = "" Then
MsgBox "No uppercase characters!"
Else
Application.Goto wks.Range(UpperCaseAddr)
MsgBox "Tab through the selection"
End If

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ken wrote:

How can I search in a cell for any letter in a word that may be upper case?
For example I want to identify that a cell has a word such as ibuPROfen.


--

Dave Peterson