prooney653
New Member
- Joined
- Dec 8, 2016
- Messages
- 2
I have inherited a spreadsheet which I am trying to get working again. I have a few basic Macro skills however I cannot get this one to work.
I have a spreadsheet that has checkboxes, and would like to put a timestamp in the checkboxes when they checked. Checkboxes are in the upper right hand corner of the cell and timestamp should be in the bottom of the cell.
I am getting a error that Macros are disabled or not available in this workbook. However I know they are and I have it saved as an macro enables workbook.
When I step into the code, I see I am getting an application.caller error=2023. I have researched and cannot find how to fix.
Please let me know if you have any suggestions on how to fix. Below is the macro
Sub CheckBox_Date_Stamp()
Dim cbx As CheckBox
'Application.Caller returns the name of the CheckBox that called this macro
Set cbx = ActiveSheet.CheckBoxes(Application.Caller)
'.TopLeftCell returns the cell address located at the top left corner of the cbx checkbox
With cbx.TopLeftCell.Offset(0, 0)
'Check the checkbox status (checked or unchecked)
If cbx.Value = xlOn Then
' Checkbox is Checked
.Value = Date
Else
' Checkbox is unchecked
.Value = ""
End If
End With
End Sub
I have a spreadsheet that has checkboxes, and would like to put a timestamp in the checkboxes when they checked. Checkboxes are in the upper right hand corner of the cell and timestamp should be in the bottom of the cell.
I am getting a error that Macros are disabled or not available in this workbook. However I know they are and I have it saved as an macro enables workbook.
When I step into the code, I see I am getting an application.caller error=2023. I have researched and cannot find how to fix.
Please let me know if you have any suggestions on how to fix. Below is the macro
Sub CheckBox_Date_Stamp()
Dim cbx As CheckBox
'Application.Caller returns the name of the CheckBox that called this macro
Set cbx = ActiveSheet.CheckBoxes(Application.Caller)
'.TopLeftCell returns the cell address located at the top left corner of the cbx checkbox
With cbx.TopLeftCell.Offset(0, 0)
'Check the checkbox status (checked or unchecked)
If cbx.Value = xlOn Then
' Checkbox is Checked
.Value = Date
Else
' Checkbox is unchecked
.Value = ""
End If
End With
End Sub