Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to find code D. Excel Discussion (Misc queries) 2 August 12th 07 06:16 PM
Find last row code Mike Milmoe Excel Discussion (Misc queries) 2 June 11th 07 08:48 PM
VBA code 'find next' Simon[_10_] Excel Programming 3 October 29th 03 08:02 AM
Find Code Bob Phillips[_5_] Excel Programming 0 July 25th 03 01:53 PM
VBA Code to FIND Christine[_4_] Excel Programming 3 July 17th 03 08:24 PM


All times are GMT +1. The time now is 09:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"