+ Reply to Thread
Results 1 to 6 of 6

series of Checkboxes to select worksheet's data

  1. #1
    Registered User
    Join Date
    03-07-2006
    Posts
    19

    Unhappy series of Checkboxes to select worksheet's data

    hi,

    Can anyone help me with this problem?

    I have a series of checkboxes on one form which allow user to select any mixture of checkbox and click on the generate button to transfer the selected worksheet's data on to a consolidated worksheet.


    How do i write a code to extract the series of checkboxes selected and perform certain action.

    Thank you,

    Regards,
    Bruce

  2. #2
    Bob Phillips
    Guest

    Re: series of Checkboxes to select worksheet's data

    Bruce,

    Here is how to test all the checkboxes, assuming that it is Forms toolbar
    checkboxes

    Sub Macro1()
    Dim cb As CheckBox
    For Each cb In ActiveSheet.CheckBoxes
    If cb.Value = 1 Then
    Debug.Print cb.Name
    End If
    Next cb
    End Sub

    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "brucelim80" <[email protected]> wrote
    in message news:[email protected]...
    >
    > hi,
    >
    > Can anyone help me with this problem?
    >
    > I have a series of checkboxes on one form which allow user to select
    > any mixture of checkbox and click on the generate button to transfer
    > the selected worksheet's data on to a consolidated worksheet.
    >
    >
    > How do i write a code to extract the series of checkboxes selected and
    > perform certain action.
    >
    > Thank you,
    >
    > Regards,
    > Bruce
    >
    >
    > --
    > brucelim80
    > ------------------------------------------------------------------------
    > brucelim80's Profile:

    http://www.excelforum.com/member.php...o&userid=32244
    > View this thread: http://www.excelforum.com/showthread...hreadid=526330
    >




  3. #3
    Registered User
    Join Date
    03-07-2006
    Posts
    19
    hi again,
    Thank for your help. However, it seem that it cant work.
    The form i am referring to is a VBA form which you create under the viual basic script editor.

    Thank

  4. #4
    Bob Phillips
    Guest

    Re: series of Checkboxes to select worksheet's data

    Dim ctl As Control
    For Each ctl In Me.Controls
    If TypeName(ctl) = "CheckBox" Then
    Debug.Print ctl.Name
    End If
    Next ctl


    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "brucelim80" <[email protected]> wrote
    in message news:[email protected]...
    >
    > hi again,
    > Thank for your help. However, it seem that it cant work.
    > The form i am referring to is a VBA form which you create under the
    > viual basic script editor.
    >
    > Thank
    >
    >
    > --
    > brucelim80
    > ------------------------------------------------------------------------
    > brucelim80's Profile:

    http://www.excelforum.com/member.php...o&userid=32244
    > View this thread: http://www.excelforum.com/showthread...hreadid=526330
    >




  5. #5
    Registered User
    Join Date
    03-07-2006
    Posts
    19

    Smile

    hi ,
    Thank for your help. sorry i need your help again.

    How do i display those that have been ticked instead of all the checkboxes? I had tried your code and it display all the name of the checkbox.

  6. #6
    Bob Phillips
    Guest

    Re: series of Checkboxes to select worksheet's data

    You just test the value for True

    Dim ctl As Control
    For Each ctl In Me.Controls
    If TypeName(ctl) = "CheckBox" Then
    If ctl.Value Then
    Debug.Print ctl.Name
    End If
    End If
    Next ctl


    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "brucelim80" <[email protected]> wrote
    in message news:[email protected]...
    >
    > hi ,
    > Thank for your help. sorry i need your help again.
    >
    > How do i display those that have been ticked instead of all the
    > checkboxes? I had tried your code and it display all the name of the
    > checkbox.
    >
    >
    > --
    > brucelim80
    > ------------------------------------------------------------------------
    > brucelim80's Profile:

    http://www.excelforum.com/member.php...o&userid=32244
    > View this thread: http://www.excelforum.com/showthread...hreadid=526330
    >




+ 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