I am using this script to add Dates and a time stamp to the Sheet specified in the Script. It works, but it is also adding the Date and Time to a completely different worksheet. The name is not even close. I have to use this Format because Wonderware Historian uses this format to pull data out and this is how it reads tag values.
Once again, the script works great for the sheet that it is intended to, but I don't know why it is adding the Dates and times to the other sheet.
I'm sure this is a simple error and I am fairly new to VBA. Thank you for your help and please excuse any incompetence
Once again, the script works great for the sheet that it is intended to, but I don't know why it is adding the Dates and times to the other sheet.
I'm sure this is a simple error and I am fairly new to VBA. Thank you for your help and please excuse any incompetence
Code:
Private Sub Workbook_Open()
Dim MeasData As Worksheet
Set MeasData = Worksheets("Measurement Data")
MeasData.Range("A2").Value = Format(Now(), "MM/dd/yyyy 02:30:00 PM")
MeasData.Range("A7").Value = Format(Now(), "MM/dd/yyyy 10:30:00 PM")
MeasData.Range("A12").Value = Format(Now(), "MM/dd/yyyy 06:30:00 AM")
End Sub