+ Reply to Thread
Results 1 to 5 of 5

Count Check Boxes

  1. #1
    Tony
    Guest

    Count Check Boxes

    I have created a column that has check Boxes using the Control Toolbar. How
    do I count the total number of checkc boxs in a column, that have check marks
    in them. I do not know VBA, only know how to create and paste a function was
    already set up for me. Thanks in advance, Tony

  2. #2
    Dave Peterson
    Guest

    Re: Count Check Boxes

    You can set up a LinkedCell for each checkbox. (It's under properties when you
    rightclick on the checkbox (while in design mode).)

    Then you can put those in a column (hidden) in the same row as the checkbox.

    then
    =countif(e:e,true)
    (use the correct column, though)

    Tony wrote:
    >
    > I have created a column that has check Boxes using the Control Toolbar. How
    > do I count the total number of checkc boxs in a column, that have check marks
    > in them. I do not know VBA, only know how to create and paste a function was
    > already set up for me. Thanks in advance, Tony


    --

    Dave Peterson

  3. #3
    Tony
    Guest

    Re: Count Check Boxes

    Thanks Dave,

    This worked exactly like you said it would. I have 5,000 rows, do I have to
    do the LINKCELL for every row.

    "Dave Peterson" wrote:

    > You can set up a LinkedCell for each checkbox. (It's under properties when you
    > rightclick on the checkbox (while in design mode).)
    >
    > Then you can put those in a column (hidden) in the same row as the checkbox.
    >
    > then
    > =countif(e:e,true)
    > (use the correct column, though)
    >
    > Tony wrote:
    > >
    > > I have created a column that has check Boxes using the Control Toolbar. How
    > > do I count the total number of checkc boxs in a column, that have check marks
    > > in them. I do not know VBA, only know how to create and paste a function was
    > > already set up for me. Thanks in advance, Tony

    >
    > --
    >
    > Dave Peterson
    >


  4. #4
    Dave Peterson
    Guest

    Re: Count Check Boxes

    How about something like this that will assign the linked cell to Column A of
    the same row that holds the checkbox (from the Control toolbox toolbar):

    Option Explicit
    Sub testme()

    Dim OLEObj As OLEObject
    Dim wks As Worksheet
    Set wks = Worksheets("sheet1")

    For Each OLEObj In wks.OLEObjects
    If TypeOf OLEObj.Object Is MSForms.CheckBox Then
    OLEObj.LinkedCell _
    = wks.Cells(OLEObj.TopLeftCell.Row, "A") _
    .Address(external:=True)
    End If
    Next OLEObj

    End Sub

    If you're new to macros, you may want to read David's intro at:
    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    Change that "A" to whatever column you really want.



    Tony wrote:
    >
    > Thanks Dave,
    >
    > This worked exactly like you said it would. I have 5,000 rows, do I have to
    > do the LINKCELL for every row.
    >
    > "Dave Peterson" wrote:
    >
    > > You can set up a LinkedCell for each checkbox. (It's under properties when you
    > > rightclick on the checkbox (while in design mode).)
    > >
    > > Then you can put those in a column (hidden) in the same row as the checkbox.
    > >
    > > then
    > > =countif(e:e,true)
    > > (use the correct column, though)
    > >
    > > Tony wrote:
    > > >
    > > > I have created a column that has check Boxes using the Control Toolbar. How
    > > > do I count the total number of checkc boxs in a column, that have check marks
    > > > in them. I do not know VBA, only know how to create and paste a function was
    > > > already set up for me. Thanks in advance, Tony

    > >
    > > --
    > >
    > > Dave Peterson
    > >


    --

    Dave Peterson

  5. #5
    Tony
    Guest

    Re: Count Check Boxes

    WOW! Marvelous, Fantastic, PERFECT,,,,,,,,Thanks

    "Dave Peterson" wrote:

    > How about something like this that will assign the linked cell to Column A of
    > the same row that holds the checkbox (from the Control toolbox toolbar):
    >
    > Option Explicit
    > Sub testme()
    >
    > Dim OLEObj As OLEObject
    > Dim wks As Worksheet
    > Set wks = Worksheets("sheet1")
    >
    > For Each OLEObj In wks.OLEObjects
    > If TypeOf OLEObj.Object Is MSForms.CheckBox Then
    > OLEObj.LinkedCell _
    > = wks.Cells(OLEObj.TopLeftCell.Row, "A") _
    > .Address(external:=True)
    > End If
    > Next OLEObj
    >
    > End Sub
    >
    > If you're new to macros, you may want to read David's intro at:
    > http://www.mvps.org/dmcritchie/excel/getstarted.htm
    >
    > Change that "A" to whatever column you really want.
    >
    >
    >
    > Tony wrote:
    > >
    > > Thanks Dave,
    > >
    > > This worked exactly like you said it would. I have 5,000 rows, do I have to
    > > do the LINKCELL for every row.
    > >
    > > "Dave Peterson" wrote:
    > >
    > > > You can set up a LinkedCell for each checkbox. (It's under properties when you
    > > > rightclick on the checkbox (while in design mode).)
    > > >
    > > > Then you can put those in a column (hidden) in the same row as the checkbox.
    > > >
    > > > then
    > > > =countif(e:e,true)
    > > > (use the correct column, though)
    > > >
    > > > Tony wrote:
    > > > >
    > > > > I have created a column that has check Boxes using the Control Toolbar. How
    > > > > do I count the total number of checkc boxs in a column, that have check marks
    > > > > in them. I do not know VBA, only know how to create and paste a function was
    > > > > already set up for me. Thanks in advance, Tony
    > > >
    > > > --
    > > >
    > > > Dave Peterson
    > > >

    >
    > --
    >
    > Dave Peterson
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1