Unhide Non-Blank rows

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Unhide Non-Blank rows

Post by adam »

The following code Unhides all the hidden rows within the range specified in the code. How the code could be changed so that it unhides all the Non blank rows within the given range.

Code: Select all

SubUnhideBlankRows()
On Error Resume Next
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim rw As Long
For rw = 28 To 53
Range("A" & rw).EntireRow.Hidden = False
Next rw
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
Any help would be kindly appreciated.
Best Regards,
Adam

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Re: Unhide Non-Blank rows

Post by VegasNath »

What column(s) would you like to check?

Something like this maybe?

Code: Select all

Sub UnhideBlankRows()

Dim rw As Long

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

    For rw = 28 To 53
        If Not Range("A" & rw) = "" Then
            Range("A" & rw).EntireRow.Hidden = False
        End If
    Next rw
    
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True

End Sub
:wales: Nathan :uk:
There's no place like home.....

User avatar
HansV
Administrator
Posts: 78512
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Unhide Non-Blank rows

Post by HansV »

Also see the threads Hide Empty Rows with formula from Range and Unhide Hidden Rows where you basically asked the same question.
Best wishes,
Hans

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Re: Unhide Non-Blank rows

Post by adam »

Thanks for the help Nathan. Your code suits my needs. & also thanks for the reply Hans.
Best Regards,
Adam