Maybe you could create a log worksheet (hide it if you want).
Then plop in the year/month in one of the cells after your code does what it
needs to do.
But change the beginning of the code to check for that value first. If the code
finds it, a little error/warning message and dump them out (or let them override
it???).
I created a worksheet named Log.
I put "Year/Month" in A1
I put "UserName" in B1
I put "Date/Time" in C1
Then I used this as a shell
Option Explicit
Sub testme()
Dim LogRng As Range
Dim okToContinue As Boolean
Dim res As Variant
Dim Ans As Long
With Worksheets("Log")
Set LogRng = .Range("a:a")
res = Application.Match(Format(Date, "yyyy_mm"), LogRng, 0)
If IsError(res) Then
'not found
okToContinue = True
Else
Ans = MsgBox(Prompt:="Again?", Buttons:=vbYesNo)
If Ans = vbYes Then
okToContinue = True
End If
End If
If okToContinue = False Then
Exit Sub
End If
End With
'call YourMacroHere
'add it back to the log (may be a duplicate!)
With Worksheets("log")
With .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0)
.Value = Format(Date, "yyyy_mm")
.Offset(0, 1).Value = Application.UserName
With .Offset(0, 2)
.Value = Now
.NumberFormat = "mm/dd/yyyy hh:mm:ss"
End With
End With
'make sure you save the updated version of the log
.Parent.Save
End With
End Sub
There are other options. If it's just you running the code, you could add
something to the windows registry. If it's others (and you don't want the
original file changed), you could put the log in a separate workbook--or just
create a text file.
Kind'a depends.