+ Reply to Thread
Results 1 to 3 of 3

Hide rows below a table

  1. #1
    Registered User
    Join Date
    09-11-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    3

    Hide rows below a table

    Hi I have a worksheet that has multiple tables on it and a userform with command buttons to show/hide the tables. I added some rows to my cost sheet and updated the code to match the new parameters but now when I press the command button it doesn't hide the blank rows below the table, it just keeps going with blank rows. Here is the code, what am I missing? This was working prior to me adding rows to the sheet itself. I went from active sheet ending at AG174 to AG214.

    '
    'Show Cost Sheet
    '
    Private Sub CostCommandButton_Click()
    '
    ' Turn off screen updating
    '
    Dim CostReportRge As Range

    Set CostReportRge = ActiveSheet.Range("U93:AG214")

    ActiveSheet.Unprotect Password:="XXX" ' Unprotect sheet to Select Range

    Application.ScreenUpdating = False
    '
    ' Unhide All Rows and Columns
    '
    CostReportRge.Select
    If Selection.EntireColumn.Hidden = True Then 'if Hidden Then
    Selection.EntireColumn.Hidden = False
    End If
    If Selection.EntireRow.Hidden = True Then 'if Hidden Then
    Selection.EntireRow.Hidden = False
    Else
    ActiveSheet.Range("A134:A214").Select
    Selection.EntireRow.Hidden = False
    End If

    '
    ' Hide Morning Report Columns
    '
    ActiveSheet.Range("A:U").Select
    Selection.EntireColumn.Hidden = True
    '
    ' Hide Morning Report Rows
    '
    ActiveSheet.Range("A1:A92").Select
    Selection.EntireRow.Hidden = True
    '
    ' Turn on screen updating
    '
    Application.ScreenUpdating = True
    ActiveSheet.Range("AB100:AB100").Select
    ActiveSheet.Protect Password:="XXX", DrawingObjects:=True, Scenarios:=True
    End Sub

  2. #2
    Registered User
    Join Date
    09-11-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    3

    Re: Hide rows below a table

    Sorry for not using code tags, I am trying to fix but the 'go advanced' button is not working properly for me, my browser just kind of times out and I have to keep refreshing to get functionality back.

  3. #3
    Registered User
    Join Date
    09-11-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    3

    Re: Hide rows below a table

    With code tags

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Pivot Table total rows hide?
    By EnergyEngineer in forum Excel General
    Replies: 3
    Last Post: 04-29-2008, 02:56 PM
  2. How do I hide rows in a pivot table with zero values?
    By fs in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-22-2006, 04:15 PM
  3. Pivot Table - How to hide all rows which is 0
    By Ctech in forum Excel General
    Replies: 2
    Last Post: 05-03-2006, 08:56 AM
  4. Replies: 0
    Last Post: 11-02-2005, 06:20 PM
  5. Replies: 0
    Last Post: 11-02-2005, 06:17 PM

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