Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all
How would I insert the date into a cell (programatically) then change its data type to text. Currently, when I open the file days later, of course, Excel populates the cells with the current date. My desired end result is subsequent openings will display the date the cell was originally populated. (Needs to stay the same always.) Does anyone have a better idea how to do this? I have the following With oExcel .Range("L1").Select .Selection.NumberFormat = "General" .ActiveCell.FormulaR1C1 = "WorkOrder" .Range("L2").Select .ActiveCell.FormulaR1C1 = z .Range("L3").Select .ActiveCell.FormulaR1C1 = z .Range("L2").Select .Selection.AutoFill Destination:=.Range("L2:L3"), Type:=xlFillDefault .Range("L2:L3").Select ' .Selection.AutoFill Destination:=.Range("L2:L99"), Type:=xlFillDefault .Selection.AutoFill Destination:=.Range("L2:L" & DATAcount + 1), Type:=xlFillDefault ' .Range("L2:L99").Select .Range("M1").Select .Selection.NumberFormat = "@" '"General" .ActiveCell.FormulaR1C1 = "DateRun" .Range("M2").Select .ActiveCell.FormulaR1C1 = "=TODAY()" .Range("M3").Select .ActiveCell.FormulaR1C1 = "=TODAY()" .Range("M2:M3").Select .Selection.AutoFill Destination:=.Range("M2:M" & DATAcount + 1), Type:=xlFillDefault ' .Range("M2:M99").Select ' .ActiveWindow.LargeScroll Down:=-2 ' .ActiveWindow.LargeScroll ToRight:=-1 .Range("N1").Select ' .ActiveWorkbook.Save .ActiveWorkbook.Close SaveChanges:=True End With Regards Dale |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change ref type | Excel Discussion (Misc queries) | |||
How do you change the data type of a cell using VBA? | New Users to Excel | |||
Change chart type in single data series, Excel 2007 | Charts and Charting in Excel | |||
how to change all the words of one type(Gunsuh type)to another | Excel Discussion (Misc queries) | |||
Can I use TODAY Function in a formula that will not change it the. | Excel Discussion (Misc queries) |