Option Explicit
Sub FindCellsWithAsterisks()
Dim cell As Range, FirstAddress As String, FoundList As String
With ActiveSheet.UsedRange
Set cell = .Find("~*", LookIn:=xlValues, SearchOrder:=xlByRows, _
LookAt:=xlPart)
If Not cell Is Nothing Then
FirstAddress = cell.Address
Do
FoundList = FoundList & "Cell " & cell.Address(0, 0) & _
" =" & vbTab & cell & vbNewLine
Set cell = .FindNext(cell)
Loop Until cell Is Nothing Or cell.Address = FirstAddress
End If
End With
MsgBox FoundList
Set cell = Nothing
End Sub
Sub FindCellsWithQuestionMarks()
Dim cell As Range, FirstAddress As String, FoundList As String
With ActiveSheet.UsedRange
Set cell = .Find("~?", LookIn:=xlValues, SearchOrder:=xlByRows, _
LookAt:=xlPart)
If Not cell Is Nothing Then
FirstAddress = cell.Address
Do
FoundList = FoundList & "Cell " & cell.Address(0, 0) & _
" =" & vbTab & cell & vbNewLine
Set cell = .FindNext(cell)
Loop Until cell Is Nothing Or cell.Address = FirstAddress
End If
End With
MsgBox FoundList
Set cell = Nothing
End Sub
Sub FindFormulasWithAsterisks()
Dim cell As Range, FirstAddress As String, FoundList As String
With ActiveSheet.UsedRange
Set cell = .Find("~*", LookIn:=xlFormulas, SearchOrder:=xlByRows, _
LookAt:=xlPart)
If Not cell Is Nothing Then
FirstAddress = cell.Address
Do
If cell.Formula Like "=*" Then
FoundList = FoundList & "Cell " & cell.Address(0, 0) & _
" =" & vbTab & cell.Formula & vbNewLine
End If
Set cell = .FindNext(cell)
Loop Until cell Is Nothing Or cell.Address = FirstAddress
End If
End With
MsgBox FoundList
Set cell = Nothing
End Sub
Sub FindCellsWithAsterisks2()
Dim cell As Range, FoundList As String
For Each cell In ActiveSheet.UsedRange
If InStr(cell, "*") Then
FoundList = FoundList & "Cell " & cell.Address(0, 0) & _
" =" & vbTab & cell & vbNewLine
End If
Next
MsgBox FoundList
End Sub
Sub FindCellsWithQuestionMarks2()
Dim cell As Range, FoundList As String
For Each cell In ActiveSheet.UsedRange
If InStr(cell, "?") Then
FoundList = FoundList & "Cell " & cell.Address(0, 0) & _
" =" & vbTab & cell & vbNewLine
End If
Next
MsgBox FoundList
End Sub
Sub FindFormulasWithAsterisks2()
Dim cell As Range, FoundList As String
For Each cell In ActiveSheet.UsedRange
If InStr(cell.Formula, "*") And cell.Formula Like "=*" Then
FoundList = FoundList & "Cell " & cell.Address(0, 0) & _
" =" & vbTab & cell.Formula & vbNewLine
End If
Next
MsgBox FoundList
End Sub
|