Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Todays date as default

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Clovis, NM
    Posts
    345
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Today's date should appear automatically in an unprotected cell of a protected sheet. The user may then move on, accepting it by default, or replace it with another date. All unprotected cells will be wiped clean for the next use of the form so I don't think =TODAY() is the way to go. I know an auto open macro could plug today's date in the appropriate cell and the wipe clean macro could do the same. Is there a better way?

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Las Vegas Nevada USA
    Posts
    239
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Here's a little ditty I use before print to put in the date and a footer with the path.
    the date will not change unless you want it to.

    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    Dim sht As Worksheet
    Dim intResponse As Integer
    'Prompts the user for a date if printing the PROPOSAL
    If ActiveSheet.Name = ("PROPOSAL") Then
    Range("F28").Select
    intResponse = MsgBox(prompt:="INSERT TODAY'S DATE?", _
    Buttons:=vbQuestion + vbYesNoCancel, Title:="REMINDER")
    Select Case intResponse
    Case vbYes
    ActiveCell.FormulaR1C1 = "=TODAY()"
    Selection.NumberFormat = "mmmm d, yyyy"
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=False
    Application.CutCopyMode = False
    Case vbNo
    Exit Sub
    Case vbCancel
    Cancel = True
    End Select
    End If
    'Inserts the path in the footer of every sheet
    For Each sht In ThisWorkbook.Sheets
    sht.PageSetup.LeftFooter = "&8" & _
    ThisWorkbook.FullName
    Next sht
    End Sub
    George

    Learn to listen. Opportunity sometimes knocks very softly.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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