Find - search in upward direction
Rob,
To search in reverse you could use a for next loop:
For x = 1000 To 21 Step -1
Cells(x, 2).Select '< Starts at B1000
ActiveCell.Offset(0, 1) = InvDate
ActiveCell.Offset(0, 2) = InvName
ActiveCell.Offset(0, 3) = InvAmount
Next
This starts in B1000 and each pass rounf the loop x reduces by 1.
Mike
"RobN" wrote:
Is there a way to modify the Find section of my code (below) so that it will
look for the value starting from the bottom of the range.
There may be more than one occurrence of the InvNum and I want it to find
the last occurrence.
(Maybe there's an alternative if modifying the Find code doesn't do it?)
Dim InvName
Dim InvDate
Dim InvNum
Dim InvAmount
'The values in these ranges are determined by the Invoice that's opened.
Set InvName = Range("D13")
Set InvDate = Range("I4")
Set InvNum = Range("I2")
Set InvAmount = Range("J48")
Windows("Records (CURRENT YEAR) Modifying.xls").Activate
With Sheets("Tax Invoice Records").Range("B21:B1000")
.Find(InvNum, LookIn:=xlValues).Select
ActiveCell.Offset(0, 1) = InvDate
ActiveCell.Offset(0, 2) = InvName
ActiveCell.Offset(0, 3) = InvAmount
End With
Rob
|