Skyhawk32806
New Member
- Joined
- May 8, 2010
- Messages
- 26
So my 2nd question for today...
I have lots of data in sheet2. I need to find the right 'code' in column D with the correct date in column C. Once the row of information is found I need to stop the loop, as there will only be one instance in the file. But from what I'm reading a loop is a bad idea (take too long?, as I have to do this loop business about 40 with different codes and dates...)
For example:
Can it be accomplished using something like
but then also looking at the cell offset 0, -1? I'm just not sure what the best way to do something like this.
By the way I have just over 10,000 rows of data.
Thanks again, you guys are great.
I have lots of data in sheet2. I need to find the right 'code' in column D with the correct date in column C. Once the row of information is found I need to stop the loop, as there will only be one instance in the file. But from what I'm reading a loop is a bad idea (take too long?, as I have to do this loop business about 40 with different codes and dates...)
For example:
Code:
For Each c In Range("D:D")
If c.Value = code And cDriverValue.Offset(0, -1) = WeekStartDate Then
c.Offset(0, 1).Value.Copy
Sheet2.Range("C1").PasteSpecial
Exit For
End If
Next c
Can it be accomplished using something like
Code:
Cells.Find(What:=Code, After:=[A1], LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Activate
but then also looking at the cell offset 0, -1? I'm just not sure what the best way to do something like this.
By the way I have just over 10,000 rows of data.
Thanks again, you guys are great.