xL_challenged
New Member
- Joined
- Mar 30, 2011
- Messages
- 4
I'm attempting a workbook_open event that runs on two sheets. When I push the "run" button in VBA the code works fine, but I can't get it to initiate when I open the workbook. And I'm not smart. Can you help? Here's what Ive got in "thisworkbook" module:
Private Sub workbook_open()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws
If [A1] = "" Then
.Unprotect Password:="secret"
.[A1] = DateValue(Date)
.Protect Password:="secret"
End If
End With
Next ws
End Sub
Private Sub workbook_open()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws
If [A1] = "" Then
.Unprotect Password:="secret"
.[A1] = DateValue(Date)
.Protect Password:="secret"
End If
End With
Next ws
End Sub