+ Reply to Thread
Results 1 to 3 of 3

Hiding rows between the last row of data and row 100

Hybrid View

  1. #1
    Registered User
    Join Date
    12-19-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    11

    Hiding rows between the last row of data and row 100

    Hi everyone,

    i really need some help with this, im looking for some code to hide all the rows between 2 rows after the last row of data and row 100.
    ive tried plenty of things but always get an error for a type mismatch. any help will be really appreciated

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Hiding rows between the last row of data and row 100

    Try

    Rows(Cells(99, 1).End(xlUp).Row + 3 & ":" & 100).RowHeight = 0

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Hiding rows between the last row of data and row 100

    Try this
    Option Explicit
    
    Sub HideEmptyRows()
        Dim rRng As Range
        Dim lRws As Long
        With Sheet1
            Set rRng = .Cells(1, 1).CurrentRegion
            lRws = rRng.Rows.Count + 2
            On Error Resume Next
    'toggle visibility
            .Rows(lRws & ":100").EntireRow.Hidden = Not .Rows(lRws & _
                ":100").EntireRow.Hidden
            On Error GoTo 0
        End With
    End Sub
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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