Check Box --- Cell Links

thunderfoot

Board Regular
Joined
May 28, 2004
Messages
229
I have a table with nearly 300 records on one worksheet. On another worksheet I have a Template which is to be populated with the details of a specific record from the table of 300, and then printed.

My thoughts were to use a 'Check Box' against each record, which I could use to select a specific record to populate the Template and then have a macro attached to the 'Check Box' to print the Template (and one or two other 'bits'!!).

The problem I have with the 'Check Box' is that when I copy each 'Check Box' to another cell, against each of the 300 records, the 'Cell Link' always refers to original 'Check Box .. Cell Link'.

Is there a way around this, or is there a better solution than using a 'Check Box' against each record?
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Found some coding that does the trick nicely.

Code:
Sub InsertCheckBoxes()
'
    Dim WrkRange, aCell As Range
    Dim RowHt, ColWd As Single
    Dim PosLeft, PosTop As Long

    Set WrkRange = Selection
    
    RowHt = ActiveCell.Height
    ColWd = ActiveCell.Width
    
    For Each aCell In WrkRange
    PosLeft = (aCell.Column - 1) * ColWd
    PosTop = (aCell.Row - 1) * RowHt
    ActiveSheet.CheckBoxes.Add(PosLeft, PosTop, 10, 10).Select
    With Selection
    .LinkedCell = aCell.Address
    .Characters.Text = ""
    End With
    aCell.NumberFormat = ";;;"
    Next aCell

End Sub
 
Upvote 0
I'd say using checkboxes for 300 records is a bit much of an overkill. Why don't you use a selection inputbox and let the user select the records that have to be used?
 
Upvote 0
I've used the above code to generate about 300 'Check Boxes' with their own unique cell references.

Can anyone advise as to what the additional bit of code would be to Select all the 'Check Boxes' so that I can Group them.
 
Upvote 0

Forum statistics

Threads
1,202,993
Messages
6,052,968
Members
444,622
Latest member
Kriszilla

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