Hello,
I am trying to paste directly one row below the specific cell on the "Paste" sheet that equals the value from another sheet (Planning). My code has been functional, but sporadically and I often get reference errors. Both of these cells will contain formulas, so the fnd needs to account for that and I think that might be my issue. Note that the macro would be run from a third sheet (which also seems to be causing issues, I believe my references are off. )
I am trying to paste directly one row below the specific cell on the "Paste" sheet that equals the value from another sheet (Planning). My code has been functional, but sporadically and I often get reference errors. Both of these cells will contain formulas, so the fnd needs to account for that and I think that might be my issue. Note that the macro would be run from a third sheet (which also seems to be causing issues, I believe my references are off. )
VBA Code:
[FONT=Calibri]Sub Paste()
Set inputsheet = ThisWorkbook.Sheets("Paste")
fnd = Worksheets("Planning").Range("B3").Value
Set myRange = inputsheet.UsedRange
Set LastCell = myRange.Cells(myRange.Cells.Count)
Set foundCell = myRange.Find(What:=fnd, After:=LastCell)
Set Rng = foundCell
Set Rng = Rng.Offset(1, 0)
Rng.PasteSpecial Paste:=xlPasteValues
End Sub[/FONT]