Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Mar 2001
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Auto date worksheets (Office 2000)

    I know how to get Excel to insert the current date Today() in a cell. But is there a way to to have Excel automatically insert the date of the worksheet and then not have it change the next time the worksheet is opened?

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto date worksheets (Office 2000)

    I'm not sure what you are asking. Do you want the date inserted into a particular cell of every new workbook that is created? That sounds like it would be a PITA to me! If that is not what you want, then could you describe it a little more.

    To manually put the date into a cell just select the cell and press Ctrl+; (hold down the control key and press the semicolon).

    I also have a button on my toolbar that executes this macro:

    <pre>Sub InsertDateTime()
    ActiveCell.Value = Now()
    ActiveCell.Offset(0, 1).Select
    End Sub
    </pre>

    Legare Coleman

  3. #3
    2 Star Lounger
    Join Date
    Mar 2001
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto date worksheets (Office 2000)

    Thanks for the quick response. Yes I want a new date in every new worksheet that I open. Your macro might be the answer for me. I am just trying to automate things as much as possible for my employees. We use a spreadsheet to count our cash register nightly. I have each month as a different workbook with the worksheets representing the days of the month. I don't know what a PITA is.

    TIA

    Bret

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto date worksheets (Office 2000)

    PITA is a Pain In The Anatomy (pick your part).

    If you want to do this just for the workbooks that will be used to count the cash registers, then you could create a template that would be used to create that workbook. In that template you could put a routine like the one below in the Workbook Open event routine of the template.

    <pre>Private Sub Workbook_Open()
    If ThisWorkbook.Path = "" And Sheet1.Range("A1") = "" Then
    Sheet1.Range("A1") = Now()
    Sheet1.Range("A1").EntireColumn.AutoFit
    End If
    End Sub
    </pre>


    I have also attached a template with this in the Workbook Open procedure to show how it would work. If you really want this to happen for every new workbook created, you could name this template Book.xlt and put it in the XLStart directory.
    Attached Files Attached Files
    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •