Help with this Find code please

  • Thread starter Thread starter bob
  • Start date Start date
B

bob

Even though there are Formulas in the range they are notr being found.

With Range(rngMyRange.Address)
Set rngMyCell = .Find(After:=ActiveCell, LookIn:=xlFormulas)
If (Not rngMyCell Is Nothing) Then
strFirstAddress = rngMyCell.Address
Do
Set rngMyCell = .FindNext(rngMyCell)
If (Mid(rngMyCell.Formula, 1, 1) = "=") Then strData =
rngMyCell.Formula
Loop While Not rngMyCell Is Nothing And rngMyCell.Address <>
strFirstAddress
End If
End With
 
That is because you are not looking for anything. Lookin:=xlformulas
doesn't mean to find any cell with a formula.

If you want all the cells with formulas

Dim rng as Range, cell as Range
set rng = Activesheet.UsedRange.SpecialCells(xlFormulas)

for each cell in Rng

Next
 
Back
Top