PDA

View Full Version : auto populate cell in worksheet



talytech
09-26-2008, 10:21 AM
Is there a way to have a cell auto populated when the user opens the worksheet? The following code did not work for me.

Private Sub Worksheet_Activate()
Worksheets("Multiple Rooms").Range("I2").Value = Date

End Sub


Basically, I want the current date to automatically be in the cell I2 when the user opens the form.

Bob Phillips
09-26-2008, 11:10 AM
Did you put that code in the worksheet code module?

talytech
09-26-2008, 11:31 AM
yes

talytech
09-26-2008, 11:37 AM
I fixed it. thank you ... I put the code on the workbook code module instead of the worksheet. Here's what I have:

Private Sub Workbook_Open()
With Sheets("Multiple Rooms")
.Select

.Unprotect ""

Worksheets("Multiple Rooms").Range("I2").Value = Date

.Protect
End With

End Sub