Checkbox trigger macro

rikvny02

Board Regular
Joined
Aug 9, 2022
Messages
78
Office Version
  1. 365
Platform
  1. Windows
I have a very simple macro to run based off a checkbox and it either doesn't work or it crashed my workbook. Please help.

Private Sub Worksheet_Change(ByVal Target As Range)
If CheckBox12 Then
completed
End If

End Sub


Sub completed()
[j36] = Environ("username") & " " & Now


End Sub
 
To be certain that we're on the same page,
these are sheet modules
View attachment 88454

these are userform modules
View attachment 88456

these are standard modules
View attachment 88457
If the checkbox control is on a sheet and both subs are in a sheet module, both should run as long as the first one runs and checkbox is True.
If checkbox is on a sheet and you moved completed() to a standard module, it should error because completed() would have no awareness of where J36 is. For that reason, I suspect you have your module terminology incorrect. Either that or you did move it to a standard module but included a sheet reference that you're not showing.
I currently have Completed() in Standard Module 1 and Checkbox in Sheet1 module. Everything works great.
When both the Checkbox and Completed() were in the same sheet module nothing work.
 
Upvote 0

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,215,651
Messages
6,126,023
Members
449,281
Latest member
redwine77

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