+ Reply to Thread
Results 1 to 7 of 7

hiding rows with checkbox

Hybrid View

Guest hiding rows with checkbox 05-26-2005, 05:19 PM
Guest Re: hiding rows with checkbox 05-26-2005, 05:19 PM
Guest Re: hiding rows with checkbox 05-26-2005, 05:19 PM
Guest Re: hiding rows with checkbox 05-26-2005, 05:19 PM
Guest Re: hiding rows with checkbox 05-26-2005, 05:19 PM
Guest Re: hiding rows with checkbox 05-26-2005, 05:19 PM
Guest RE: hiding rows with checkbox 05-26-2005, 05:19 PM
  1. #1
    Qaspec
    Guest

    hiding rows with checkbox

    I'm using the following to hide rows from a checkbox. My question is how can
    i get it to unhide the rows if the checkbox is unmarked?

    Private Sub CB1_Click()
    For a = 10 To 30
    Cells(a, 1).Select
    Selection.EntireRow.Hidden = True


    Next a
    End Sub

  2. #2
    Daniel CHEN
    Guest

    Re: hiding rows with checkbox

    check the checkbox status
    if cb1.value = true then
    // code for hide
    else
    // code for unhide
    endif
    ===== * ===== * ===== * =====
    Daniel CHEN

    UDQServices@Gmail.com
    www.Geocities.com/UDQServices
    >Free Data Processing Add-in<

    ===== * ===== * ===== * =====

    "Qaspec" <Qaspec@discussions.microsoft.com> wrote in message
    news:805D96A1-7FA5-4FB1-AE0B-0FED7429C5D9@microsoft.com...
    > I'm using the following to hide rows from a checkbox. My question is how
    > can
    > i get it to unhide the rows if the checkbox is unmarked?
    >
    > Private Sub CB1_Click()
    > For a = 10 To 30
    > Cells(a, 1).Select
    > Selection.EntireRow.Hidden = True
    >
    >
    > Next a
    > End Sub




  3. #3
    Norman Jones
    Guest

    Re: hiding rows with checkbox

    Hi Qaspec,

    Try:

    Private Sub CB1_Click()
    Range("A10:A30").EntireRow.Hidden = CB1.Value
    End Sub


    ---
    Regards,
    Norman



    "Qaspec" <Qaspec@discussions.microsoft.com> wrote in message
    news:805D96A1-7FA5-4FB1-AE0B-0FED7429C5D9@microsoft.com...
    > I'm using the following to hide rows from a checkbox. My question is how
    > can
    > i get it to unhide the rows if the checkbox is unmarked?
    >
    > Private Sub CB1_Click()
    > For a = 10 To 30
    > Cells(a, 1).Select
    > Selection.EntireRow.Hidden = True
    >
    >
    > Next a
    > End Sub




  4. #4
    Qaspec
    Guest

    Re: hiding rows with checkbox

    In addition to those rows i would also like to hide/unhide row 4 on sheet2.
    How do i add that into the sub?

    "Norman Jones" wrote:

    > Hi Qaspec,
    >
    > Try:
    >
    > Private Sub CB1_Click()
    > Range("A10:A30").EntireRow.Hidden = CB1.Value
    > End Sub
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "Qaspec" <Qaspec@discussions.microsoft.com> wrote in message
    > news:805D96A1-7FA5-4FB1-AE0B-0FED7429C5D9@microsoft.com...
    > > I'm using the following to hide rows from a checkbox. My question is how
    > > can
    > > i get it to unhide the rows if the checkbox is unmarked?
    > >
    > > Private Sub CB1_Click()
    > > For a = 10 To 30
    > > Cells(a, 1).Select
    > > Selection.EntireRow.Hidden = True
    > >
    > >
    > > Next a
    > > End Sub

    >
    >
    >


  5. #5
    STEVE BELL
    Guest

    Re: hiding rows with checkbox

    Just add the sheet reference:

    Sheets("Sheet2").Rows(4).EntireRow.Hidden = CB1.Value

    --
    rand451
    "Qaspec" <Qaspec@discussions.microsoft.com> wrote in message
    news:39216FBB-E10C-4761-973B-48FA7847CBDE@microsoft.com...
    > In addition to those rows i would also like to hide/unhide row 4 on
    > sheet2.
    > How do i add that into the sub?
    >
    > "Norman Jones" wrote:
    >
    >> Hi Qaspec,
    >>
    >> Try:
    >>
    >> Private Sub CB1_Click()
    >> Range("A10:A30").EntireRow.Hidden = CB1.Value
    >> End Sub
    >>
    >>
    >> ---
    >> Regards,
    >> Norman
    >>
    >>
    >>
    >> "Qaspec" <Qaspec@discussions.microsoft.com> wrote in message
    >> news:805D96A1-7FA5-4FB1-AE0B-0FED7429C5D9@microsoft.com...
    >> > I'm using the following to hide rows from a checkbox. My question is
    >> > how
    >> > can
    >> > i get it to unhide the rows if the checkbox is unmarked?
    >> >
    >> > Private Sub CB1_Click()
    >> > For a = 10 To 30
    >> > Cells(a, 1).Select
    >> > Selection.EntireRow.Hidden = True
    >> >
    >> >
    >> > Next a
    >> > End Sub

    >>
    >>
    >>




  6. #6
    STEVE BELL
    Guest

    Re: hiding rows with checkbox

    Try this. (note that there is no selection needed)

    Private Sub CheckBox1_Click()
    If CheckBox1 = True Then
    Range(Rows(10), Rows(30)).EntireRow.Hidden = True
    ElseIf CheckBox1 = False Then
    Range(Rows(10), Rows(30)).EntireRow.Hidden = False
    End If
    End Sub


    --
    rand451
    "Qaspec" <Qaspec@discussions.microsoft.com> wrote in message
    news:805D96A1-7FA5-4FB1-AE0B-0FED7429C5D9@microsoft.com...
    > I'm using the following to hide rows from a checkbox. My question is how
    > can
    > i get it to unhide the rows if the checkbox is unmarked?
    >
    > Private Sub CB1_Click()
    > For a = 10 To 30
    > Cells(a, 1).Select
    > Selection.EntireRow.Hidden = True
    >
    >
    > Next a
    > End Sub




  7. #7
    Alok
    Guest

    RE: hiding rows with checkbox

    Just change the following line
    Selection.EntireRow.Hidden = CB1.Value
    Alok Joshi


    "Qaspec" wrote:

    > I'm using the following to hide rows from a checkbox. My question is how can
    > i get it to unhide the rows if the checkbox is unmarked?
    >
    > Private Sub CB1_Click()
    > For a = 10 To 30
    > Cells(a, 1).Select
    > Selection.EntireRow.Hidden = True
    >
    >
    > Next a
    > End Sub


+ 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