Solved

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

Posted on 2014-03-19
4
1,695 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 47

Accepted Solution

by:
Martin Liss earned 250 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 33

Assisted Solution

by:Norie
Norie earned 250 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 47

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

Technology Partners: 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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

756 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