Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add date to cell with open macro
This should have been easy for me to figure out but I couldn't do it. I'm
just trying to have a cell auto-populate with the current date. I can't use the =today() function on the sheet because it changes the date on old copies when they are opened. I would like this to be a workbook_open macro that works with the one I have below to advance invoice dates. The cell I would like the date to populate in is M13. Thank, Duane. Private Sub Workbook_Open() Range("m3").Value = Range("m3").Value + 1 End Sub -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200708/1 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add date to cell with open macro
give this a try
Range("m3").Value = Date Paul B "DDub207 via OfficeKB.com" <u36243@uwe wrote in message news:760baa1848918@uwe... This should have been easy for me to figure out but I couldn't do it. I'm just trying to have a cell auto-populate with the current date. I can't use the =today() function on the sheet because it changes the date on old copies when they are opened. I would like this to be a workbook_open macro that works with the one I have below to advance invoice dates. The cell I would like the date to populate in is M13. Thank, Duane. Private Sub Workbook_Open() Range("m3").Value = Range("m3").Value + 1 End Sub -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200708/1 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add date to cell with open macro
Duane,
To put the current date in M3: Range("m3").Value = Date -- Hope that helps. Vergel Adriano "DDub207 via OfficeKB.com" wrote: This should have been easy for me to figure out but I couldn't do it. I'm just trying to have a cell auto-populate with the current date. I can't use the =today() function on the sheet because it changes the date on old copies when they are opened. I would like this to be a workbook_open macro that works with the one I have below to advance invoice dates. The cell I would like the date to populate in is M13. Thank, Duane. Private Sub Workbook_Open() Range("m3").Value = Range("m3").Value + 1 End Sub -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200708/1 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add date to cell with open macro
I presume if m13 already has something in it, it's an "old copy", so you
wouldn't want to put the date in if there's already something in m13. This just adds the date to m13 if it's empty. HTH, James Private Sub Workbook_Open() Range("m3").Value = Range("m3").Value + 1 If Range("m13") = "" Then Range("m13") = Now End Sub "DDub207 via OfficeKB.com" <u36243@uwe wrote in message news:760baa1848918@uwe... This should have been easy for me to figure out but I couldn't do it. I'm just trying to have a cell auto-populate with the current date. I can't use the =today() function on the sheet because it changes the date on old copies when they are opened. I would like this to be a workbook_open macro that works with the one I have below to advance invoice dates. The cell I would like the date to populate in is M13. Thank, Duane. Private Sub Workbook_Open() Range("m3").Value = Range("m3").Value + 1 End Sub -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200708/1 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add date to cell with open macro
Thanks... It works.
Paul B wrote: give this a try Range("m3").Value = Date Paul B This should have been easy for me to figure out but I couldn't do it. I'm just trying to have a cell auto-populate with the current date. I can't [quoted text clipped - 9 lines] Range("m3").Value = Range("m3").Value + 1 End Sub -- Message posted via http://www.officekb.com |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add date to cell with open macro
Thanks... It works.
Vergel Adriano wrote: Duane, To put the current date in M3: Range("m3").Value = Date This should have been easy for me to figure out but I couldn't do it. I'm just trying to have a cell auto-populate with the current date. I can't use [quoted text clipped - 6 lines] Range("m3").Value = Range("m3").Value + 1 End Sub -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200708/1 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add date to cell with open macro
Thanks for your help.
Zone wrote: I presume if m13 already has something in it, it's an "old copy", so you wouldn't want to put the date in if there's already something in m13. This just adds the date to m13 if it's empty. HTH, James Private Sub Workbook_Open() Range("m3").Value = Range("m3").Value + 1 If Range("m13") = "" Then Range("m13") = Now End Sub This should have been easy for me to figure out but I couldn't do it. I'm just trying to have a cell auto-populate with the current date. I can't [quoted text clipped - 9 lines] Range("m3").Value = Range("m3").Value + 1 End Sub -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200708/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Display Current Date & Time in a cell: Everytime I open the workbo | Excel Worksheet Functions | |||
Open file if cell date is less than today+30 day? | Excel Worksheet Functions | |||
Open an Excel file with a date as today in a macro | Excel Discussion (Misc queries) | |||
open cell formationg dialogue from macro | Excel Programming | |||
on open goto cell with today's date | Excel Programming |