Macro to create date when sheet opens and then remain static when

P

paankadu

I have a workbook with 2 sheets.

Day Log
Night Log

Each sheet will have several locked cells to keep users from making changes.
The date cell will be locked. I need for the workbook to enter the current
date on both sheets when the workbook is initially opened. The user will
then make their entries and the file will be saved with a new name thru
documentum. Would then need this file to maintain that date and not change
to the current date again if the workbook ever needs to be re-opened.

I had submitted a similar earlier post a couple of weeks ago and I believe
Jacob had assisted me with it, but now I can't find that post. It worked
great for 1 sheet but I couldn't get it to work on multiple sheets.

I appreciate any help you can give me. I tried looking thru some of the
various help links thru out the posts but didn't quite find what I was
looking for.
 
D

Don Guillett

You did not post the code but you could put into the ThisWorkbook module
using a worksheet_open event to unlock>put DATE into a desired cell>lock.
 
J

Jacob Skaria

Hi Again

Try the below modified version of the previous maro....Replace your existing
code withn workbook Open event

Private Sub Workbook_Open()
Dim Sh As Worksheet
For Each Sh In Sheets
With Sh
..Unprotect Password:="password"
..Range("A1") = Date
..Protect Password:="password"
End With
Next
End Sub

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top