Solved

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

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

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

732 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