Dealing with 'Today()' formula in Excel VBA code
Solved/Closed
masinyaka
Posts
3
Registration date
Tuesday September 9, 2014
Status
Member
Last seen
September 25, 2014
-
Sep 23, 2014 at 07:25 AM
masinyaka Posts 3 Registration date Tuesday September 9, 2014 Status Member Last seen September 25, 2014 - Sep 25, 2014 at 01:06 PM
masinyaka Posts 3 Registration date Tuesday September 9, 2014 Status Member Last seen September 25, 2014 - Sep 25, 2014 at 01:06 PM
Related:
- Dealing with 'Today()' formula in Excel VBA code
- Number to words in excel formula without vba - Guide
- Battery reset code - Guide
- Excel grade formula - Guide
- Date formula in excel dd/mm/yyyy - Guide
- Samsung volume increase code - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Sep 23, 2014 at 11:38 AM
Sep 23, 2014 at 11:38 AM
Hi Masinyaka,
Change the following line
Selection.FormulaR1C1 = "=TODAY()"
into:
Selection = Now
Best regards,
Trowa
Change the following line
Selection.FormulaR1C1 = "=TODAY()"
into:
Selection = Now
Best regards,
Trowa
Sep 24, 2014 at 08:12 AM
Thanks for the suggestion. I have done what you suggest, however the problem still persist.
Any additional help?
Regards
Masinyaka
Sep 25, 2014 at 11:00 AM
Then I'm not sure what the issue is?
You said that all previous date's changed to today's date.
That was because you used a formula, which will always show today's date.
With my adjustment you will no longer enter a formula but a value, which won't change.
If you still have the TODAY function on your sheet, then those date's will change, but the newly entered date's won't, right?
Could you clarify your issue?
Best regards,
Trowa
Sep 25, 2014 at 01:06 PM
My bad. I see where the problem is. I still entered your suggesting as a formula
i.e. Selection = "Now()" instead of
Selection = Now
After clearing the mix-up it works perfectly fine.
Thanks very much for your time. Am grateful
Masinyaka