Looking for a macro which enters date of today when ticking a tickbox Hello Exce
ID: 642886 • Letter: L
Question
Looking for a macro which enters date of today when ticking a tickbox
Hello Excel(lent) users,
I have created a list and in column T I have created Tickboxes. I want to connect these boxes to a macro, so when a user ticks one of these boxes, I want the next field in the same row (in column U) to be filled with today's date in such a way that the date is fixed and doesn't change tomorrow or at a later stage.
So when I tick the box in T3, I want today's date to be entered in U3.
I know how to connect the macro to the tick box, but the code of the macro I am not able to create myself.
Thanks !!
Explanation / Answer
Hi...
try this :
This is for an ActiveX checkbox and it utilises the topleft property to work out where the checkbox is so if the top left corner of the checkbox is in t3 then we use row 3 to write the date to column U.
Enter design mode and right click the checkbox and view code and paste this line of code in. You will need to correct the checkbox number.
Cells(CheckBox1.TopLeftCell.Row, "U") = Date
The syntax for a forms checkbox is this.
Cells(ActiveSheet.Shapes(Application.Caller).TopLeftCell.Row, "U") = Date
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.