ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Writing saveing date in cell when saveing. (https://www.excelbanter.com/excel-programming/333552-writing-saveing-date-cell-when-saveing.html)

a94andwi[_2_]

Writing saveing date in cell when saveing.
 

Hello.

I have a problem I don't know how to solve.
I want my workbook to write the current day in cell A1 when I save my
workbook.
Is there a built in function for this or how do I write it in VBA?

/Anders


--
a94andwi
------------------------------------------------------------------------
a94andwi's Profile: http://www.excelforum.com/member.php...o&userid=21077
View this thread: http://www.excelforum.com/showthread...hreadid=384312


Anne Troy[_2_]

Writing saveing date in cell when saveing.
 
Hi, Anders. Open your workbook. Hit Alt+F11 to open the Visual Basic Editor.
Place the following code in the ThisWorkbook module of your workbook. Change
("Sheet1").Range("A1") to the location where you want the date in your
workbook.


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Sheets("Sheet1").Range("A1") = Now
End Sub
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com



"a94andwi" wrote in
message ...

Hello.

I have a problem I don't know how to solve.
I want my workbook to write the current day in cell A1 when I save my
workbook.
Is there a built in function for this or how do I write it in VBA?

/Anders


--
a94andwi
------------------------------------------------------------------------
a94andwi's Profile:

http://www.excelforum.com/member.php...o&userid=21077
View this thread: http://www.excelforum.com/showthread...hreadid=384312




Patrick Molloy[_2_]

Writing saveing date in cell when saveing.
 
Sub AddListBox()
With ActiveSheet.ListBoxes.Add(314.25, 51.75, 63, 246.75)
.Select
With Selection
.ListFillRange = "MyListData"
.LinkedCell = "$G$3"
End With
End With
End Sub

"a94andwi" wrote:


Hello.

I have a problem I don't know how to solve.
I want my workbook to write the current day in cell A1 when I save my
workbook.
Is there a built in function for this or how do I write it in VBA?

/Anders


--
a94andwi
------------------------------------------------------------------------
a94andwi's Profile: http://www.excelforum.com/member.php...o&userid=21077
View this thread: http://www.excelforum.com/showthread...hreadid=384312




All times are GMT +1. The time now is 09:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com