Hide and Unhide the rows if the formula result is ""

Malhotra Rahul

Board Regular
Joined
Nov 10, 2017
Messages
92
Hi, May i get help on VBA script to hide and unhide the rows if the formula result is "" in Summary worksheet from Range cell B17:B240. So by pressing the button it should hide the blank rows with unhide if the cell value range from B17:B240 not equal to "".
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Code:
Public Sub HideUnhide()
Dim iRows As Long, r As Long


Range("B17").Select
iRows = ActiveSheet.UsedRange.Rows.Count
For r = 17 To iRows
   Rows(r & ":" & r).EntireRow.Hidden = ActiveCell.Value = ""
Next
End Sub
 
Last edited:
Upvote 0
I have used the formula from cell B17 to B240 in the Summary Sheet. if the match not found then the cell value would be "" and if the matches found then accordingly the results have been displayed. Accordingly i need VBA script.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top