check box

  • Thread starter Thread starter Check Box Guru''s
  • Start date Start date
C

Check Box Guru''s

I have many check boxes on my sheet (150) How can I auto fill the associated
linked cell?
 
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
 
Back
Top