Results 1 to 3 of 3

VBA : Hide Blank Rows

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-05-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2016
    Posts
    110

    VBA : Hide Blank Rows

    Dear all,

    Need you help with correcting / simplifying macro to hide blank rows.

    PFA for the sheet. Row 18 is not being hidden.

    Sub Hide_UnusedRows()
    
        'Hide Unused Rows
        
        Application.ScreenUpdating = False
        
        Sheets("Sheet1").Select
        Range("A1").Select
        
        Dim LastRow As Long
        LastRow = ActiveSheet.UsedRange.Rows.Count
        
        For i = 4 To LastRow
    
            If ActiveSheet.Range("B" & i) = "" Then
                ActiveSheet.Rows(i).Hidden = True
            End If
        
        Next
        
        Application.ScreenUpdating = True
    
        Range("A1").Select
        ActiveWorkbook.Save
        
    End Sub
    Request your help in correcting the code.

    Thanks,
    Vinod Krishna
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hide Blank Rows
    By divamarsh in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-06-2014, 06:20 PM
  2. Hide blank rows
    By ABSTRAKTUS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2012, 01:56 PM
  3. Hide Blank rows
    By Charity in forum Excel General
    Replies: 15
    Last Post: 11-23-2006, 08:20 AM
  4. Hide Blank Rows
    By dee in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-17-2006, 06:35 PM
  5. Formula to hide blank rows
    By Ladyra in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-25-2005, 03:06 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