Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Plain Text by registered user beny1014 ( 14 years ago )
1. sub checkbox()
2.
3. 'STARTTOP AND STARTLEFT NEED TO BE ADJUSTED TO DESIRED POSITION ON SHEET
4. Const StartTop As Double = 4493.25
5. Const StartLeft As Double = 1029
6. 'MODIFY HEIGHT AND WIDTH FOR BOX SIZE
7. Const CBWidth As Double = 11
8. Const CBHeight As Double = 11
9. 'MODIFY HIEGHT PLUS FOR DISTANCE TO NEXT ROW, IE ROW HEIGHT IN POINTS
10. '0.75 POINTS PER PIXEL
11. Const HeightPlus As Double = 13.5
12. Dim CB As Object
13. Dim i As Long
14.
15. 'MODIFY COUNT TO BE THE FIRST ROW NUMBER THAT THE CHECKBOX WILL BE ADDED TO
16. Count = 335
17. 'MODIFY COUNT1 FOR NEXT NUMBER IN CHECKBOX SEQUENCE
18. count1 = 610
19.
20. With ActiveSheet
21.
22. 'MODIFY "21" FOR NUMBER OF BOXES TO BE ADDED
23. For i = 1 To 21
24. 'MODIFY "T" FOR REFERENCE COLUMN BOX TO BE TIED TO
25. cellnumber = "T" & Count
26. checkname = "CheckBox" & count1
27.
28. Set CB = .OLEObjects.Add(ClassType:="Forms.CheckBox.1", _
29. Link:=False, _
30. DisplayAsIcon:=False, _
31. Left:=StartLeft, _
32. Top:=StartTop + (i - 1) * HeightPlus, _
33. Width:=CBWidth, _
34. Height:=CBHeight)
35.
36. ActiveSheet.OLEObjects(checkname).LinkedCell = cellnumber
37.
38. Count = Count + 1
39. count1 = count1 + 1
40.
41. Next
42. End With
43.
44.
45.
End Sub
Revise this Paste
Parent: 54751