I am trying to copy and paste the value of a certain cell (D16) onto another sheet. This value changes every hour. I have the below code but I am getting an error message at frng.Offset(1,0).PasteSpecial (xlPasteValues). Its telling me Run-time error '91': Object variable or With Block variable not set.
Any idea whats causing this issue? Recommend any changes?
Any idea whats causing this issue? Recommend any changes?
Code:
Sub CopyPaste2()
Dim ws1 As Worksheet, ws2 As Worksheet, rng As Range, frng As Range
Set ws1 = Worksheets("Sheet2")
Set ws2 = Worksheets("Sheet3")
Set rng = ws1.Range("D16")
Set frng = ws2.Rows(1).Find(What:=Time, After:=Range("A1"), LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False)
rng.Copy
frng.Offset(1, 0).PasteSpecial (xlPasteValues)
Application.CutCopyMode = 0
End Sub