+ Reply to Thread
Results 1 to 6 of 6

Hide/Unhide Help

  1. #1
    Registered User
    Join Date
    05-28-2004
    Posts
    5

    Question Hide/Unhide Help

    I have been through the search on numerious occasions and can't find an answer. Here is my problem.

    I have a sheet for my work load. I want to hide rows that have a blank cell in colum B when a key is pressed. However, I want the rows to unhide when the workbook is opened.

    Any help would be greatly appreciated.

    Thanks,
    Danno

  2. #2
    Jake Marx
    Guest

    Re: Hide/Unhide Help

    Hi Danno,

    If you have a subroutine that will hide/unhide as needed:

    Public Sub ToggleRows(rbHide As Boolean)
    Dim rng As Range

    Set rng = Sheet1.UsedRange.Columns(2).SpecialCells( _
    xlCellTypeBlanks)

    If Not rng Is Nothing Then
    rng.EntireRow.Hidden = rbHide
    End If
    End Sub

    You can call this with a True argument when hiding the rows with blank col
    B. You can call this subroutine with a False argument from the
    Workbook_Open event subroutine (double-click ThisWorkbook icon and paste in
    the following code):

    Private Sub Workbook_Open()
    ToggleRows False
    End Sub

    --
    Regards,

    Jake Marx
    www.longhead.com


    [please keep replies in the newsgroup - email address unmonitored]


    Danno wrote:
    > I have been through the search on numerious occasions and can't find
    > an answer. Here is my problem.
    >
    > I have a sheet for my work load. I want to hide rows that have a blank
    > cell in colum B when a key is pressed. However, I want the rows to
    > unhide when the workbook is opened.
    >
    > Any help would be greatly appreciated.
    >
    > Thanks,
    > Danno




  3. #3
    Registered User
    Join Date
    05-28-2004
    Posts
    5
    Jake,

    Thank you for the reply. I am not sure what I am doing wrong. Keep getting exictuable errors.

    Danno

  4. #4
    Jake Marx
    Guest

    Re: Hide/Unhide Help

    Danno,

    Danno wrote:
    > Thank you for the reply. I am not sure what I am doing wrong. Keep
    > getting exictuable errors.


    In my example, I used Sheet1 as the worksheet object. You should change
    this to Sheets("<yoursheetname>") - other than that, it should work. Can
    you post your code and indicate the line that raises the error along with
    the error # and description?

    --
    Regards,

    Jake Marx
    www.longhead.com


    [please keep replies in the newsgroup - email address unmonitored]



  5. #5
    Jake Marx
    Guest

    Re: Hide/Unhide Help

    Danno,

    Danno wrote:
    > Thank you for the reply. I am not sure what I am doing wrong. Keep
    > getting exictuable errors.


    In my example, I used Sheet1 as the worksheet object. You should change
    this to Sheets("<yoursheetname>") - other than that, it should work. Can
    you post your code and indicate the line that raises the error along with
    the error # and description?

    --
    Regards,

    Jake Marx
    www.longhead.com


    [please keep replies in the newsgroup - email address unmonitored]



  6. #6
    Jake Marx
    Guest

    Re: Hide/Unhide Help

    Danno,

    Danno wrote:
    > Thank you for the reply. I am not sure what I am doing wrong. Keep
    > getting exictuable errors.


    In my example, I used Sheet1 as the worksheet object. You should change
    this to Sheets("<yoursheetname>") - other than that, it should work. Can
    you post your code and indicate the line that raises the error along with
    the error # and description?

    --
    Regards,

    Jake Marx
    www.longhead.com


    [please keep replies in the newsgroup - email address unmonitored]



+ 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