Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Findnext problem

Hi

I have a problem with the FindNext function. The find is working fine,
but FindNext return nothing. Here's my code:

Set FindRes = Cells.Find(What:="0005", LookIn:=xlValues)
If Not FindRes Is Nothing Then
FirstAddress = FindRes.Address
Do
Set FindRes = Cells.FindNext(After:=FindRes)
Loop While Not FindRes Is Nothing And FindRes.Address <
FirstAddress
End If

My function is call by a formula, If I move my code in a macro that I
call by the menu, everything goes fine.

Does soneone have an idea what shoul I do to have my code working? I've
tried with other parameters in the find call with no chance

Thanks

Luc

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Findnext problem

Hi Luc,

My function is call by a formula, If I move my code in a macro that I
call by the menu, everything goes fine.


Prior (I believe) to XL2002, Find could not be used in a worksheet function.


---
Regards,
Norman



wrote in message
ups.com...
Hi

I have a problem with the FindNext function. The find is working fine,
but FindNext return nothing. Here's my code:

Set FindRes = Cells.Find(What:="0005", LookIn:=xlValues)
If Not FindRes Is Nothing Then
FirstAddress = FindRes.Address
Do
Set FindRes = Cells.FindNext(After:=FindRes)
Loop While Not FindRes Is Nothing And FindRes.Address <
FirstAddress
End If

My function is call by a formula, If I move my code in a macro that I
call by the menu, everything goes fine.

Does soneone have an idea what shoul I do to have my code working? I've
tried with other parameters in the find call with no chance

Thanks

Luc



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Findnext problem

Hi Norman,

It seems that XL2003 have the same problem.

Thanks,

Luc

Norman Jones a écrit :

Hi Luc,

My function is call by a formula, If I move my code in a macro that I
call by the menu, everything goes fine.


Prior (I believe) to XL2002, Find could not be used in a worksheet function.


---
Regards,
Norman



wrote in message
ups.com...
Hi

I have a problem with the FindNext function. The find is working fine,
but FindNext return nothing. Here's my code:

Set FindRes = Cells.Find(What:="0005", LookIn:=xlValues)
If Not FindRes Is Nothing Then
FirstAddress = FindRes.Address
Do
Set FindRes = Cells.FindNext(After:=FindRes)
Loop While Not FindRes Is Nothing And FindRes.Address <
FirstAddress
End If

My function is call by a formula, If I move my code in a macro that I
call by the menu, everything goes fine.

Does soneone have an idea what shoul I do to have my code working? I've
tried with other parameters in the find call with no chance

Thanks

Luc


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Findnext problem

Are you sure that the find next is not working correctly? You are only
returning the very last cell found. You keep on overwriting your range object
with each FindNext...

If your intention is to return a range consisting of all of the found cells
then you need to use the union function to make one big range... If you need
help with that let me know...
--
HTH...

Jim Thomlinson


" wrote:

Hi Norman,

It seems that XL2003 have the same problem.

Thanks,

Luc

Norman Jones a écrit :

Hi Luc,

My function is call by a formula, If I move my code in a macro that I
call by the menu, everything goes fine.


Prior (I believe) to XL2002, Find could not be used in a worksheet function.


---
Regards,
Norman



wrote in message
ups.com...
Hi

I have a problem with the FindNext function. The find is working fine,
but FindNext return nothing. Here's my code:

Set FindRes = Cells.Find(What:="0005", LookIn:=xlValues)
If Not FindRes Is Nothing Then
FirstAddress = FindRes.Address
Do
Set FindRes = Cells.FindNext(After:=FindRes)
Loop While Not FindRes Is Nothing And FindRes.Address <
FirstAddress
End If

My function is call by a formula, If I move my code in a macro that I
call by the menu, everything goes fine.

Does soneone have an idea what shoul I do to have my code working? I've
tried with other parameters in the find call with no chance

Thanks

Luc



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
Findnext Noemi Excel Discussion (Misc queries) 1 December 12th 05 11:23 AM
Find...FindNext Problem mtsark Excel Programming 4 August 19th 04 04:09 PM
FindNext problem mark kubicki Excel Programming 4 February 14th 04 02:42 AM
FindNext problem when using PasteSpecial Glyn Baker Excel Programming 1 December 6th 03 08:40 PM
problem with .FindNext Bob Cochran Excel Programming 6 October 11th 03 02:02 PM


All times are GMT +1. The time now is 11:37 PM.

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"