Runtime error 1004
Method 'Range' of object '_Global' failed
The purpose of this is because i'm copying and pasting data into this workbook, and will want to track the date/time that this data was extracted. This data is actually the script of a webpage but I'm unable to incorporate the date when I'm copying it, so I am trying to save the date when I paste it in my workbook. I will use the saved sheet for subsequent steps.
Sub savedate() If Intersect(Target, Range(“A1”)) Is Nothing Then Exit Sub Else ActiveSheet.SaveAs ("Libraries\Documents\Tempcode" & format(Now(), "DD-MMM-YYYY hh mm AMPM") & ".xlsx") End If End Sub
From novice to tech pro — start learning today.