Hi,
I am facing "Run-time error 438" Object doesn't support this property or method for below coding in excel:
Option Explicit
Public interval As Date
Sub macro_timer()
interval = Now + TimeValue("00:00:10")
Application.OnTime interval, "MyATR"
End Sub
Sub MyATR()
' MyATR
' Keyboard Shortcut: Ctrl+Shift+R
Dim LstRw As Long, RepLst As Long 'varialble for last in Sheet 1 and Report
'Delete 163 rows after row 1 in Report first:
Application.ScreenUpdating = False
With Workbooks("Myexcel Testing.xlsm")
.Worksheets("Report").Range("A2:A164").EntireRow.Delete
RepLst = WorksheetFunction.Max(.Range("A" & .Rows.Count).End(xlUp).Row, 6) 'pick row 3 or more
' copy from Sheet 1
'With Workbooks("Myexcel Testing.xlsm")
.Worksheets("Sheet1").Range("F2:K164").Copy
' paste to same rows in Report
.Worksheets("Report").Range("A" & (RepLst + 1) & ":F" & (RepLst + 163)).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ThisWorkbook.Save
End With
Application.ScreenUpdating = True
'MsgBox "Data added to Report"
'ActiveWorkbook.Save
Call macro_timer
End Sub
Sub stop_macro()
On Error Resume Next
Application.OnTime earliesttime:=interval, procedure:="MyATR", schedule:=False
End Sub
Please help for solution.
Regards,