Hi all , I'm having a bit of a problem with my code returning an error.
I'm trying to find a value in sheet(Dty) and return it to sheet(Pur).
I'm using the code below which I've used variants of before with no problem, but for this
I'm getting an 'object variable or With block variable not set' error on the rCl.offset.
I'm not sure how to rectify it. Can anyone help??
I'm trying to find a value in sheet(Dty) and return it to sheet(Pur).
I'm using the code below which I've used variants of before with no problem, but for this
I'm getting an 'object variable or With block variable not set' error on the rCl.offset.
I'm not sure how to rectify it. Can anyone help??
Code:
Sub UpdatePurchases()
Dim Ws As Worksheet
Dim Ws5 As Worksheet
Dim Rw As Long
Dim sFind As String
Dim rCl As Range
Set Ws = Worksheets("Pur")
Set Ws5 = Worksheets("Dty")
With Ws.Range("Purchases")
For Rw = 1 To .Rows.Count
sFind = .Cells(Rw, 7).Text
With Ws5.Range("A1", Ws5.Cells(Rows.Count, "A").End(xlUp))
Set rCl = .Find(sFind, LookIn:=xlValues, lookat:=xlWhole)
Ws.Range("Purchases").Cells(Rw, 15).Value = rCl.Offset(0, 3).Value
End With
Next Rw
End With
End Sub