Set Day of Checkbox Change on Another Sheet

stusic

Board Regular
Joined
Dec 15, 2007
Messages
65
Office Version
  1. 365
Platform
  1. Windows
Hello All!

I've got a bunch of checkboxes on a sheet and, in the same cell of another sheet, I'd like to record when any of them are checked.

I understand I should use something like this to get the checkboxes:

VBA Code:
Set cb = ActiveSheet.CheckBoxes(Application.Caller)
If cb.Value = xlOn Then
...

I've seen a way to put the day on an offset cell of the same sheet:
Code:
With xChk.TopLeftCell.Offset(, 50)

This seems pretty simple, but I'm not sure how to iterate through them and place it in the corresponding cell on the other sheet and need some help :)
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Try this
VBA Code:
  Dim calleraddress As String
    
    With ActiveSheet.CheckBoxes(Application.Caller)
        If .Value = xlOff Then
            Exit Sub
        Else
            calleraddress = .TopLeftCell.Address(0, 0)
            Sheet2.Range(calleraddress) = Now
        End If
    End With
 
Upvote 1
Solution
Try this
VBA Code:
  Dim calleraddress As String
   
    With ActiveSheet.CheckBoxes(Application.Caller)
        If .Value = xlOff Then
            Exit Sub
        Else
            calleraddress = .TopLeftCell.Address(0, 0)
            Sheet2.Range(calleraddress) = Now
        End If
    End With
That is perfect! It seems much simpler than what I was trying to come up with, lol. I appreciate the help :)
 
Upvote 0

Forum statistics

Threads
1,223,749
Messages
6,174,280
Members
452,554
Latest member
Louis1225

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