Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default FindNext and Copy Help (Urgent)

This code is a little more complicated but works for me, only problem
is it generates an error if there are no values found. I create loop
that terminates when you get back to the original value. Please let
me know if this works for you or if you find a simpler way of
implementing:


'Find first instance and record location
Cells.Find(What:="31", after:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate
firstrow = ActiveCell.Row
firstcol = ActiveCell.Column
foundlast = 0



Do While foundlast = 0 'loop till at first location again

Cells.Find(What:="31", after:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate
th_row = ActiveCell.Row
th_col = ActiveCell.Column





If th_row = firstrow Then
If th_col = firstcol Then foundlast = 1

End If]




[INSERT YOUR COMMANDS HERE]



Loop
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
Can't get FindNext after deleting row? Ed[_18_] Excel Programming 2 July 15th 04 02:08 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
FindNext problem mark kubicki Excel Programming 4 February 14th 04 02:42 AM


All times are GMT +1. The time now is 07:30 PM.

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"