INSERT DATE

verluc

Well-known Member
Joined
Mar 1, 2002
Messages
1,451
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.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,385
Messages
6,119,210
Members
448,874
Latest member
b1step2far

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top