Last run date of a macro

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

dave3009

Well-known Member
Joined
Jun 23, 2006
Messages
7,128
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
  2. Mobile
  3. Web
Hi

Welcome to the Board

Not unless some kind of timestamp was built into the macro.

KR


Dave
 

dave3009

Well-known Member
Joined
Jun 23, 2006
Messages
7,128
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
  2. Mobile
  3. Web
Perhaps adding something like

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

Change ranges to suit a disused cell well out the way cell on your spreadie (or even another hidden sheet then format your range as ;;; this way noone will see it

HTH

Dave
 

bluefuel318

New Member
Joined
Feb 8, 2007
Messages
30
Well, I came up with this:

Code:
Sub log()
Application.ScreenUpdating = False
Workbooks.OpenText Filename:="C:\Macro Run Dates.xls"
[a1].Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
ActiveCell = "Macro Name"
ActiveCell.Offset(0, 1).Select
ActiveCell = "=today()"
ActiveCell.Copy
ActiveCell.PasteSpecial xlPasteValues
Workbooks("Macro Run Dates.xls").Save
Workbooks("Macro Run Dates.xls").Close
Application.ScreenUpdating = True
End Sub

I figured I could put that at the beginning of each of my macros, and replace "Macro Name" with that sub's name. OR, if I knew how to automatically have it enter the name of the macro, I could just call the log macro at the beginning of each one. Is there a way to do that?
 

Forum statistics

Threads
1,181,053
Messages
5,927,848
Members
436,572
Latest member
khalid hussain

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
Top