Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating time made by macro in excel
I have recorded a macro in excel. The macro includes current date and current
time which are pasted into two separate cells. I use ctrl+; and ctrl+: when programming the macro. When using the macro, the values of both date and time are constantly the same as the date and time I made the macro. How may the date and time be changed to the actual time when I use the macro? Using the now() - function is not much help, as then all macros recorded change to the actual date and time. I used the program recorder.exe, and old -93-version earlier - but it does not work with Vista. Thankful if anyone can help me out here. -- hjemmehososs |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating time made by macro in excel
Hi,
Use instructions : Range("A1").Value = Date Range("B1").Value = Time HTH |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating time made by macro in excel
hi
if you did it on record then you lines of code should looks something like this.... ActiveCell.FormulaR1C1 = "12/29/07" ActiveCell.FormulaR1C1 = "1:59pm" anything in quotes will be interpeted by vb as literal which is why it keeps putting your old date and time in. change to.... ActiveCell.FormulaR1C1 = Date ActiveCell.FormulaR1C1 = Time regards FSt1 "hjemmehososs" wrote: I have recorded a macro in excel. The macro includes current date and current time which are pasted into two separate cells. I use ctrl+; and ctrl+: when programming the macro. When using the macro, the values of both date and time are constantly the same as the date and time I made the macro. How may the date and time be changed to the actual time when I use the macro? Using the now() - function is not much help, as then all macros recorded change to the actual date and time. I used the program recorder.exe, and old -93-version earlier - but it does not work with Vista. Thankful if anyone can help me out here. -- hjemmehososs |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating time made by macro in excel
Thank you very much for your advice.
It was very helpful and made my day! -- hjemmehososs "FSt1" wrote: hi if you did it on record then you lines of code should looks something like this.... ActiveCell.FormulaR1C1 = "12/29/07" ActiveCell.FormulaR1C1 = "1:59pm" anything in quotes will be interpeted by vb as literal which is why it keeps putting your old date and time in. change to.... ActiveCell.FormulaR1C1 = Date ActiveCell.FormulaR1C1 = Time regards FSt1 "hjemmehososs" wrote: I have recorded a macro in excel. The macro includes current date and current time which are pasted into two separate cells. I use ctrl+; and ctrl+: when programming the macro. When using the macro, the values of both date and time are constantly the same as the date and time I made the macro. How may the date and time be changed to the actual time when I use the macro? Using the now() - function is not much help, as then all macros recorded change to the actual date and time. I used the program recorder.exe, and old -93-version earlier - but it does not work with Vista. Thankful if anyone can help me out here. -- hjemmehososs |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need help ( Hope i made it clear this time) | Excel Worksheet Functions | |||
auto update of date and time whenever changes are made to a xcel s | Excel Worksheet Functions | |||
auto update of date and time whenever changes are made to a xcel s | Excel Worksheet Functions | |||
Formula that will record the time and date when an entry is made on a sheet | Excel Worksheet Functions | |||
WIZARD ARE YOU READY - UPDATING EXCEL FROM ACCESS IN REAL TIME | Excel Programming |