ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   macro with F9 (https://www.excelbanter.com/excel-discussion-misc-queries/38458-macro-f9.html)

Kenny

macro with F9
 
I want to a macro to insert the formula =TODAY() and then recalc it to make
it a static result that represents the date as of the time the macro is run,
not a dynamic formula that would change with each new day. I have recorded a
macro to do this. If I run the macro & today is Aug 3, the correct result
would be 08/03/2005, not the formula =TODAY(). However, if I run my macro
tomorrow, Aug 4, the macro returns a result of 08/03/2005, because the code
that resulted from my macro-record has a line in it, such as Select Active
Cell. Active Cell = "08/03/2005." I would like the macro to execute the
recalc function, not return a value that was the result when the macro was
first recorded. Would appreciate any help. Thanks.


FSt1

hi,
add this your your macro

Activecell.Value = Date

regards
FSt1

"Kenny" wrote:

I want to a macro to insert the formula =TODAY() and then recalc it to make
it a static result that represents the date as of the time the macro is run,
not a dynamic formula that would change with each new day. I have recorded a
macro to do this. If I run the macro & today is Aug 3, the correct result
would be 08/03/2005, not the formula =TODAY(). However, if I run my macro
tomorrow, Aug 4, the macro returns a result of 08/03/2005, because the code
that resulted from my macro-record has a line in it, such as Select Active
Cell. Active Cell = "08/03/2005." I would like the macro to execute the
recalc function, not return a value that was the result when the macro was
first recorded. Would appreciate any help. Thanks.



All times are GMT +1. The time now is 05:04 PM.

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