I have this code, WHICH DOESN'T WORK.
What i am doing, i enter a value in a new row in column C of sheet ("PET MILL") I want to use the find function to return the description of this reference which is in Column B of sheet("PETE REFS")
I am having a problem with the code looking for the last cell in column 3.
How do i make this work, please?
Also, What i plan to do after getting this to work is have an INPUT box that asks to input the description and add it and the PETE REF to the last row in the PETE REFS Sheet.
Any help greatly appreciated. Thanks
What i am doing, i enter a value in a new row in column C of sheet ("PET MILL") I want to use the find function to return the description of this reference which is in Column B of sheet("PETE REFS")
I am having a problem with the code looking for the last cell in column 3.
How do i make this work, please?
Also, What i plan to do after getting this to work is have an INPUT box that asks to input the description and add it and the PETE REF to the last row in the PETE REFS Sheet.
Any help greatly appreciated. Thanks
VBA Code:
Sub findPETEREF()
Dim c As Range
Dim PETEREF As Range
Set PETEREF = Sheets("PETE REFS").Range("A:A").Find(What:=Sheets("PET MILL").Range(Rows.Count, 3).End(xlUp).Row.Value, LookIn:=xlValues, lookat:=xlWhole)
If Not PETEREF Is Nothing Then
Range(Rows.Count, 3).End(xlUp).Value = PETEREF.Offset(, 4).Value
Else
MsgBox "PETE REF NOT FOUND"
End If
End Sub