ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with this Find code please (https://www.excelbanter.com/excel-programming/285724-help-find-code-please.html)

[email protected]

Help with this Find code please
 
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



Tom Ogilvy

Help with this Find code please
 
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

--
Regards,
Tom Ogilvy

wrote in message
...
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





[email protected]

Help with this Find code please
 
Thanks,

That worked, and did what I was trying to do

bob


On Wed, 17 Dec 2003 21:16:59 -0500, "Tom Ogilvy"
wrote:

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




All times are GMT +1. The time now is 03:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com