+ Reply to Thread
Results 1 to 6 of 6

Counting selected option buttons in column?

  1. #1
    -JEFF-
    Guest

    Counting selected option buttons in column?

    My option buttons are grouped by row (one per cell) so only one of five can
    be selected in each row. Now I need to know how many have been selected in
    each of the five columns and totals stored in a cell. Will one of you VBA
    gurus please help me count how many option buttons are selected in each
    column? Also, if there is a better method other than the option button to
    accomplish this, I'm all ears. I have been having the users put a number 1
    in the column and then auto sum the 1's at the bottom, (quite easy), however,
    users keep screwing up and having more than one "1" in a row so I'm need a
    better method of control.
    -JEFF-

  2. #2
    Tom Ogilvy
    Guest

    Re: Counting selected option buttons in column?

    Assuming option buttons from the control toolbox toolbar.
    If you have the optionbuttons linked to cells, then just do a countif on the
    cells for True.

    --
    Regards,
    Tom Ogilvy

    "-JEFF-" <[email protected]> wrote in message
    news:[email protected]...
    > My option buttons are grouped by row (one per cell) so only one of five

    can
    > be selected in each row. Now I need to know how many have been selected

    in
    > each of the five columns and totals stored in a cell. Will one of you VBA
    > gurus please help me count how many option buttons are selected in each
    > column? Also, if there is a better method other than the option button to
    > accomplish this, I'm all ears. I have been having the users put a number

    1
    > in the column and then auto sum the 1's at the bottom, (quite easy),

    however,
    > users keep screwing up and having more than one "1" in a row so I'm need a
    > better method of control.
    > -JEFF-




  3. #3
    -JEFF-
    Guest

    Re: Counting selected option buttons in column?

    That works except it places the word "True" or "False" inside the cell behind
    the control. It's purely aesthetics, but is there a way to prevent this?
    -JEFF-

    "Tom Ogilvy" wrote:

    > Assuming option buttons from the control toolbox toolbar.
    > If you have the optionbuttons linked to cells, then just do a countif on the
    > cells for True.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "-JEFF-" <[email protected]> wrote in message
    > news:[email protected]...
    > > My option buttons are grouped by row (one per cell) so only one of five

    > can
    > > be selected in each row. Now I need to know how many have been selected

    > in
    > > each of the five columns and totals stored in a cell. Will one of you VBA
    > > gurus please help me count how many option buttons are selected in each
    > > column? Also, if there is a better method other than the option button to
    > > accomplish this, I'm all ears. I have been having the users put a number

    > 1
    > > in the column and then auto sum the 1's at the bottom, (quite easy),

    > however,
    > > users keep screwing up and having more than one "1" in a row so I'm need a
    > > better method of control.
    > > -JEFF-

    >
    >
    >


  4. #4
    Tom Ogilvy
    Guest

    Re: Counting selected option buttons in column?

    You could format the font of the cell to be the same color as the
    background.

    You cold make the option button opaque and have it cover the cell

    --
    Regards,
    Tom Ogilvy

    "-JEFF-" <[email protected]> wrote in message
    news:[email protected]...
    > That works except it places the word "True" or "False" inside the cell

    behind
    > the control. It's purely aesthetics, but is there a way to prevent this?
    > -JEFF-
    >
    > "Tom Ogilvy" wrote:
    >
    > > Assuming option buttons from the control toolbox toolbar.
    > > If you have the optionbuttons linked to cells, then just do a countif on

    the
    > > cells for True.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > "-JEFF-" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > My option buttons are grouped by row (one per cell) so only one of

    five
    > > can
    > > > be selected in each row. Now I need to know how many have been

    selected
    > > in
    > > > each of the five columns and totals stored in a cell. Will one of you

    VBA
    > > > gurus please help me count how many option buttons are selected in

    each
    > > > column? Also, if there is a better method other than the option

    button to
    > > > accomplish this, I'm all ears. I have been having the users put a

    number
    > > 1
    > > > in the column and then auto sum the 1's at the bottom, (quite easy),

    > > however,
    > > > users keep screwing up and having more than one "1" in a row so I'm

    need a
    > > > better method of control.
    > > > -JEFF-

    > >
    > >
    > >




  5. #5
    -JEFF-
    Guest

    Re: Counting selected option buttons in column?

    Can I control the properties of these option buttons that are "from the
    control toolbox toolbar" using VBA code? When I recorded a macro and changed
    properties of an option button, it did not show up in the macro code.
    -JEFF-

    "Tom Ogilvy" wrote:

    > You could format the font of the cell to be the same color as the
    > background.
    >
    > You cold make the option button opaque and have it cover the cell
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "-JEFF-" <[email protected]> wrote in message
    > news:[email protected]...
    > > That works except it places the word "True" or "False" inside the cell

    > behind
    > > the control. It's purely aesthetics, but is there a way to prevent this?
    > > -JEFF-
    > >
    > > "Tom Ogilvy" wrote:
    > >
    > > > Assuming option buttons from the control toolbox toolbar.
    > > > If you have the optionbuttons linked to cells, then just do a countif on

    > the
    > > > cells for True.
    > > >
    > > > --
    > > > Regards,
    > > > Tom Ogilvy
    > > >
    > > > "-JEFF-" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > My option buttons are grouped by row (one per cell) so only one of

    > five
    > > > can
    > > > > be selected in each row. Now I need to know how many have been

    > selected
    > > > in
    > > > > each of the five columns and totals stored in a cell. Will one of you

    > VBA
    > > > > gurus please help me count how many option buttons are selected in

    > each
    > > > > column? Also, if there is a better method other than the option

    > button to
    > > > > accomplish this, I'm all ears. I have been having the users put a

    > number
    > > > 1
    > > > > in the column and then auto sum the 1's at the bottom, (quite easy),
    > > > however,
    > > > > users keep screwing up and having more than one "1" in a row so I'm

    > need a
    > > > > better method of control.
    > > > > -JEFF-
    > > >
    > > >
    > > >

    >
    >
    >


  6. #6
    Tom Ogilvy
    Guest

    Re: Counting selected option buttons in column?

    Yes, but you can't record the changes.

    sheet1.Textbox1.BackColor = rgb(255,0,0)

    as an example.

    --
    Regards,
    Tom Ogilvy


    "-JEFF-" <[email protected]> wrote in message
    news:[email protected]...
    > Can I control the properties of these option buttons that are "from the
    > control toolbox toolbar" using VBA code? When I recorded a macro and

    changed
    > properties of an option button, it did not show up in the macro code.
    > -JEFF-
    >
    > "Tom Ogilvy" wrote:
    >
    > > You could format the font of the cell to be the same color as the
    > > background.
    > >
    > > You cold make the option button opaque and have it cover the cell
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > "-JEFF-" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > That works except it places the word "True" or "False" inside the cell

    > > behind
    > > > the control. It's purely aesthetics, but is there a way to prevent

    this?
    > > > -JEFF-
    > > >
    > > > "Tom Ogilvy" wrote:
    > > >
    > > > > Assuming option buttons from the control toolbox toolbar.
    > > > > If you have the optionbuttons linked to cells, then just do a

    countif on
    > > the
    > > > > cells for True.
    > > > >
    > > > > --
    > > > > Regards,
    > > > > Tom Ogilvy
    > > > >
    > > > > "-JEFF-" <[email protected]> wrote in message
    > > > > news:[email protected]...
    > > > > > My option buttons are grouped by row (one per cell) so only one of

    > > five
    > > > > can
    > > > > > be selected in each row. Now I need to know how many have been

    > > selected
    > > > > in
    > > > > > each of the five columns and totals stored in a cell. Will one of

    you
    > > VBA
    > > > > > gurus please help me count how many option buttons are selected in

    > > each
    > > > > > column? Also, if there is a better method other than the option

    > > button to
    > > > > > accomplish this, I'm all ears. I have been having the users put a

    > > number
    > > > > 1
    > > > > > in the column and then auto sum the 1's at the bottom, (quite

    easy),
    > > > > however,
    > > > > > users keep screwing up and having more than one "1" in a row so

    I'm
    > > need a
    > > > > > better method of control.
    > > > > > -JEFF-
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >




+ 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