Question:
Excel 2007 adding mult check boxes to column "D" and "E" IF Column "A" is used?
BT24
2010-05-03 07:06:15 UTC
I need to add check boxes into column D and E, BUT I only want check boxes to appear if data is entered into that particular row on column A. I will be adding to this spread sheet daily, but only want check boxes to appear when I enter data for that row. I dont know how to add boxes or do any of this...
Thanks!
Three answers:
garbo7441
2010-05-03 08:30:41 UTC
You asked the same question 5 days ago, and I provided a complete workable 'how to'.



To wit:



Click the Microsoft Office Button Button image, and then click Excel Options.



In the Popular category, under Top options for working with Excel, select the Show Developer tab in the Ribbon check box, and then click OK.



On the Developer tab, in the Controls group, click Insert and then, under Form Controls, click the Check box image.



Click on cell D1, and drag in the worksheet to create the first check box.



You can size it by clicking a corner and dragging diagonally. Size it so the 'caption' field of the check box is pretty well contained inside the cell borders.



Right click the check box and select 'Edit Text'. Replace 'Check box 1' with the caption text you wish to use for this check box, or delete it completely to just show the check box.



Click off of the check box, then right click it and 'Copy'. Click cell D2 and 'Paste'.



Repeat this process for as many checkboxes you wish to add in column D. As you add check boxes, Excel will automatically name them sequentially as you paste them in.



After all check boxes have been created and added, copy the following event handling code to the clipboard:





Private Sub Worksheet_SelectionChange(ByVal Target As Range)

For i = 1 To ActiveSheet.Shapes.Count

If Range("A" & i).Value <> "" Then

ActiveSheet.Shapes("check box " & i).Visible = True

Else

ActiveSheet.Shapes("check box " & i).Visible = False

ActiveSheet.Shapes("check box " & i).ControlFormat.Value = 0

End If

Next

End Sub





Next, select the appropriate worksheet and right click the sheet tab.



Select 'View Code'



Paste the code into the sheet module editing area to the right.



Close the VBE and return to Excel.



Click on any cell. If column A contains no data, all check boxes will be hidden. If you enter text in a cell in column A linked to a check box, that check box will become visible.



NOTE: The critical aspect of the mechanics of this is that Check Box 1 will be controlled by cell A1. Check Box 2 will be controlled by A2, Check Box 3 by A3, etc. You must align them appropriately.



Also, if you create some check boxes, then delete them to start over, Excel will begin naming any new ones that you add where it left off naming the old ones.





Are you having trouble implementing it?
2016-04-14 04:54:24 UTC
Star signs are completely irrelivant of greatness. In modern English schools, pupils born in September are more statistically likely to achieve success in sport than those in August, so you could judge the star sign in that way if you wished. The characteristics of people born under star signs are only similar by coincidence, if at all.
VBAXLMan
2010-05-04 11:29:29 UTC
Yes, you did

and we answered your question



Try to keep track of your questions instead of asking again and again



VBAXLMan


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...