Timestamp at the end of a vba code

jimmyvba

New Member
Joined
Jul 19, 2013
Messages
20
Hi Guys,

I run a vba code everyday to update my reports. I would like to add a few lines to the code so that I can publish the time when it was run. This will basically help others who have access to the file to know when the report were last updated.

Any pointers? Thanks in advance.

Cheers.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
How about recording the date on a hidden sheet then a message box pop up when the workbook is open to notify the person of the date it was last run?
 
Upvote 0
I would want the code to print the time it was run on a cell. I have multiple macro buttons on a single sheet. So basically, my goal is that below each of the buttons, people will be able to see when exactly it was last run.
 
Upvote 0
Problem solved..I just added a line at the end making a cell = Now(). That does the job. Thanks.
 
Upvote 0
Extremely sorry. The problem is still there. Making a cell = NOW() doesn't work as it keeps on updating irrespective of the macro. Still looking for pointers.
 
Upvote 0
Lets say you want this date in cell A1 on Sheet1

At the bottom of each of you macros as this:

Code:
Worksheets("Sheet1").Range("A1").Value = Now()

This will put the date in as a VALUE that will only be updated when you run your macro.
 
Upvote 0
Hi Guys,

Putting those formula is what I was also doing but the time used to keep on updating on its own. So now I am basically using that formula to find the time at the end of the code and then pasting it as a text onto a cell so that it stops updating from then on.

That does the job.

Thanks for the help.

Cheers.
 
Upvote 0

Forum statistics

Threads
1,215,773
Messages
6,126,821
Members
449,340
Latest member
hpm23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top