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
Solved

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

Posted on 2014-03-19
4
1,684 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
  • 2
4 Comments
 
LVL 46

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 46

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 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