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: 9
Default Find...FindNext Problem

I am attempting to transfer scoring data (based upon two criteria) from one
worksheet to another using VBA Find and FindNext. The problem I'm having is
the Find Method only returns the first Run value. I'm fairly sure the
problem is how I'm using FindNext. I've tried some different combinations
but I can't seem to get it right.

Any help would be greatly appreciated!

Sample Source Worksheet:
Position Year Name Runs
1B 2000 Player1 2
SS 2001 Player2 10
SS 2001 Player3 4
C 2002 Player4 28

the code below only returns the value of 10:

Dim PAVTAry As Range, SrcChk1 As Range
Dim FirstAddress As String
Lr = LastRow(Sheets("3-yr Scoring")) + 1
Set PAVTAry = Sheets("3-yr Scoring").Range("A3:AH" & Lr)
Sheets("PAVT Data").Range("F2").Select
Do
Set SrcChk1 = PAVTAry.Find(What:="SS", LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByColumns, _
SearchDirection:=xlNext)
If Not SrcChk1 Is Nothing Then
FirstAddress = SrcChk1.Address
Do
Set SrcChk1 = PAVTAry.FindNext(SrcChk1)
If SrcChk1.Offset(0, 1).Value = 2001 Then
ActiveCell.Value = SrcChk1.Offset(0, 2).Value
End If
Loop While Not SrcChk1 Is Nothing And SrcChk1.Address <
FirstAddress
Else
ActiveCell.Value = "0"
End If
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, -5))

 
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
FindNext SJ[_6_] Excel Programming 7 May 21st 04 06:01 AM
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 06:49 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"