LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Help with FindNext Method

I have the following code which is searching through a coloumn of data
looking for a number when it finds it, it crosses checks it with a date
if its the one i'm looking for I store it and continue searching for
the next entry. but it doesn't appear to find any values, when I step
through the code rFound = 'Nothing' and I can't work out why. any help
would be great.

Thanks

Dwight


'Find the all occurances of Notional
Dim rFound As Range
Dim sFirstAddress As String

'Set search range to column

Set rFound = ActiveSheet.Columns(Not_Col).Find(Notional)
'If Notional was found
If Not rFound Is Nothing Then
'Store the address in a variable
sFirstAddress = rFound.Address
'Start a loop
Do
row_temp = rFound.Row
Cust_M_Dt = ActiveSheet.Cells(row_temp, M_Dat_Col).Value

If M_Date = Cust_M_Date Then
If flag = 0 Then
Swp_Rw_1 = row_temp
flag = 1
End If

If flag = 1 Then
Swp_Rw_2 = row_temp
flag = 2
End If
End If

'Find the next cell with Notional
Set rFound = ActiveSheet.Columns(Not_Col).FindNext(rFound)
'Stop when Find loops back to the first cell found
Loop Until rFound.Address = sFirstAddress
End If

 
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
Findnext Noemi Excel Discussion (Misc queries) 1 December 12th 05 11:23 AM
Can .FindNext return Nothing?? Wild Bill[_2_] Excel Programming 22 April 30th 05 07:51 PM
FindNext John Keturi Excel Programming 1 October 16th 04 01:56 PM
FindNext SJ[_6_] Excel Programming 7 May 21st 04 06:01 AM
findnext issues mark kubicki Excel Programming 3 February 15th 04 03:22 AM


All times are GMT +1. The time now is 07:17 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"