I have a macro which is being activated from multiple places and am trying to find a way to limit the way that it works, as it is causing unexpected results
The macro in question is a date stamp- it activates when a checkbox is checked, and places a stamp in the next cell
Sub Process_CheckBox(pObject)
Dim LRow As Integer
Dim LRange As String
'Find row that checkbox resides in
LRow = pObject.TopLeftCell.Row
LRange = "H" & CStr(LRow)
'Change completed date, if checkbox is checked
If pObject.Value = True Then
ActiveSheet.Range(LRange).Value = Date
End With
'Clear completed date if checkbox is unchecked
Else
ActiveSheet.Range(LRange).Value = Null
End If
End Sub
I have also placed linked checkboxes on several other sheets, so that if a checkbox is checked in one of the sheets, the corresponding box is checked in the other sheets as well, however I only want the date stamp to be issued on the master sheet
The 2 problems I'm having are:
When I check a checkbox in one of the "secondary" sheets, it puts the time stamp in that sheet. (I know that's because of me using ActiveSheet in the code, but I've tried to select the master sheet to no avail)
If i turn off the date stamp, the linked checkboxes work perfectly, but when the date stamp macro is active, and I check a checkbox in one of the secondary sheets, it DOES register the check on the master sheet, but not on the other secondary sheet.
Any suggestions as to how to tidy this up would be appreciated.
Bookmarks