ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   check box (https://www.excelbanter.com/excel-discussion-misc-queries/241266-check-box.html)

Check Box Guru''s

check box
 
I have many check boxes on my sheet (150) How can I auto fill the associated
linked cell?

Jacob Skaria

check box
 
Try the below macro...In a fresh workbook place 5 checkboxes in say cell B1
to B5. The below macro will link these to cells A1 to A5 respectively..

Sub Macro()

Dim intRow As Integer
Dim ws As Worksheet, obj As OLEObject

Set ws = Sheets("Sheet1")

For Each obj In ws.OLEObjects
If TypeName(obj.Object) = "CheckBox" Then
obj.LinkedCell = ActiveSheet.Range("A1").Offset(intRow).Address
intRow = intRow + 1
End If
Next obj

End Sub


If you are new to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()


If this post helps click Yes
---------------
Jacob Skaria


"Check Box Guru''s" wrote:

I have many check boxes on my sheet (150) How can I auto fill the associated
linked cell?



All times are GMT +1. The time now is 04:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com