On load
Go to the VBE editor (alt-F11). If you don't have a project explorer
window on the left hand side go to View and then select project
explorer. Look for the name of your workbook. Expand the section.
Then look for "ThisWorkBook". Double click on it. This should open
the code section for the workbook module. At the top is a drop down
that says "general". Select "Workbook" from that drop down. It should
default to "open" in the next drop down and put some code in the code
area. If it doesn't then select open from the events list. Insert
your line of code in the workbook open event. This will cause whatever
you put in to happen every time the workbook is opened.
Private Sub Workbook_Open
Sheet1.Range("B2").Value = Date - 1
End sub
|