![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 1,288
|
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 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,065
|
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 |
|
Board Regular
Join Date: Feb 2002
Location: Las Vegas Nevada USA
Posts: 240
|
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 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|