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

Thread: INSERT DATE

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    1,451
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    In one of my macro's,I have the following code:
    Range("D4").Value = FormatDate, "dd.mm.yyyy")
    Rows(4).AutoFit

    That means that automaticly the date of the current day is insert.

    Is there a possibility that this macro give an input-box to insert a date,because information on the sheet from a week ago gives by opening this sheet autmaticly the current date.
    Many thanks for help.

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,184
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    set the date as text .. then wont update

    or remone the code and input box and transpose the date to thte cell reqd so no updating


    Free Excel based Web Toolbar available here.

    Jack in the UK
    J & R Excel Solutions
    "making Excel work for you"

  3. #3
    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 some code I use to insert the date before print. Alter to suit. It also puts the path in the footer of all sheets in the book.

    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.

    [ This Message was edited by: GeorgeB on 2002-04-25 15:39 ]

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
  •