If a CheckBox is ticked, then select that cell and call a Module - Loop Through Until

MrsGExcel95

New Member
Joined
Mar 1, 2016
Messages
3
Hi All,

At the moment I have a code that adds checkboxes to a dynamic table (i.e. it could be 100 rows, or it could be 5 rows).

I am trying to write a code that says: "if the value next to a checkbox is "TRUE", then please select this cell and call another module.

Code:
Dim rng As Range
Dim cell As Variant
Dim lastrow As Long
Dim sht As Worksheet

Set sht = ThisWorkbook.Worksheets("Overview")

lastrow = sht.Cells(sht.Rows.Count, "M").End(xlUp).Row


Set rng = Sheets("Overview").Range("Q8:Q" & lastrow)
 
For Each cell In rng
 If cell.Value = True Then
  ActiveCell.Select
  Call Amendit
 End If
Next

Many thanks,

MrsGExcel95
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,215,455
Messages
6,124,938
Members
449,197
Latest member
k_bs

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