?
Solved

Excel  2010 - How to insert/create checkboxes in a column of cells.

Posted on 2014-03-19
4
Medium Priority
?
1,748 Views
Last Modified: 2014-03-20
I have a worksheet with data and want to have a checkbox for yes/no options.
How can I create checkboxes inside each cell in a column of cells.
I'm pretty sure I don't need the checkbox inside of
DEVELOPER/CONTROLS/INSERT/FORM CONTROLS/Checkbox

Or am I wrong.  Maybe I don't need checkboxes?
0
Comment
Question by:brothertruffle880
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
Martin Liss earned 1000 total points
ID: 39940610
Option buttons would be better for Yes/No.

Sub CreateYesNo()
Dim intQuestions As Integer
Dim intRow As Integer
Dim oleObj As OLEObject

' Uncomment these lines to erase what you did and do it again
'For Each oleObj In ActiveSheet.OLEObjects
'    oleObj.Delete
'Next
intQuestions = InputBox("How many sets of Yes/No option buttons do you want to add?", , 1)

For intRow = 1 To intQuestions
    With ActiveSheet.OLEObjects.Add(ClassType:="Forms.OptionButton.1", _
        Left:=Cells(intRow, 6).Left, _
        Top:=Cells(intRow, 6).Top, _
        Width:=Cells(intRow, 6).Width, _
        Height:=Cells(intRow, 6).Height)
        .Object.Caption = "Yes"
        .Object.GroupName = "Q" & intRow
    End With
    With ActiveSheet.OLEObjects.Add(ClassType:="Forms.OptionButton.1", _
        Left:=Cells(intRow, 7).Left, _
        Top:=Cells(intRow, 7).Top, _
        Width:=Cells(intRow, 7).Width, _
        Height:=Cells(intRow, 7).Height)
        .Object.Caption = "No"
        .Object.GroupName = "Q" & intRow
    End With
Next
End Sub

Open in new window

0
 
LVL 34

Assisted Solution

by:Norie
Norie earned 1000 total points
ID: 39940654
You could use data validation with a simple Yes/No as a list.
0
 

Author Closing Comment

by:brothertruffle880
ID: 39942785
Thank you Both.  Terrific and workable!
0
 
LVL 48

Expert Comment

by:Martin Liss
ID: 39942819
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2013
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question