I'm trying to force a default value of 0.25 in cell D21 whenever someone opens Sheet1 in an Excel 97 workbook.
I tried to use the worksheet activate event:
Private Sub Worksheet_Activate()
Worksheets("Sheet1".Range("D21".Value = 0.25
End Sub
copying this code from the Microsoft Excel Language Reference, but the cell value doesn't change when I open the workbook. There is only one worksheet, Sheet1, in the workbook.
Any idea what I am doing wrong? Do I have to declare a workbook or worksheet object first?
I tried to use the worksheet activate event:
Private Sub Worksheet_Activate()
Worksheets("Sheet1".Range("D21".Value = 0.25
End Sub
copying this code from the Microsoft Excel Language Reference, but the cell value doesn't change when I open the workbook. There is only one worksheet, Sheet1, in the workbook.
Any idea what I am doing wrong? Do I have to declare a workbook or worksheet object first?