Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Loop and find less than...

Is there a way to find cells in a loop that are less than a certian value?
something like that idea, but I know this doesn't work...
Set rngFound = rngToSearch.Find <= (Range("a56").Value)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Loop and find less than...

Dim rng as Range, cell as Range
for each cell in Range("B1:B100")
if cell.Value < Range("A56").Value then
if rng is nothing then
set rng = cell
else
set rng = Union(rng,cell)
end if
End if
Next
if not rng is nothing then
rng.Select
End if

--
Regards,
Tom Ogilvy

"John" wrote in message
...
Is there a way to find cells in a loop that are less than a certian value?
something like that idea, but I know this doesn't work...
Set rngFound = rngToSearch.Find <= (Range("a56").Value)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Loop and find less than...

Thank you sir!

"Tom Ogilvy" wrote:

Dim rng as Range, cell as Range
for each cell in Range("B1:B100")
if cell.Value < Range("A56").Value then
if rng is nothing then
set rng = cell
else
set rng = Union(rng,cell)
end if
End if
Next
if not rng is nothing then
rng.Select
End if

--
Regards,
Tom Ogilvy

"John" wrote in message
...
Is there a way to find cells in a loop that are less than a certian value?
something like that idea, but I know this doesn't work...
Set rngFound = rngToSearch.Find <= (Range("a56").Value)




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
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
Find & loop in VBA Noemi Excel Discussion (Misc queries) 3 January 25th 06 03:39 AM
Find in a loop John Excel Programming 2 August 2nd 05 06:10 PM
Find, Findnext VBA Loop SMS - John Howard Excel Programming 5 November 13th 04 03:19 AM
Find loop Jamie[_8_] Excel Programming 2 April 22nd 04 10:00 PM


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

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

About Us

"It's about Microsoft Excel"