Hiding Row if a certain cell in that row is blank

ardykav

Board Regular
Joined
Oct 18, 2015
Messages
172
Office Version
  1. 365
Platform
  1. Windows
Hi All,
I have a large budget spreadsheet where i have various codes ranging from A1-A50, however right now I only use about 15 of the codes but the other ones will be eventually populated. The description column uses an index match Formula which looks up a code list. What i want to do is hide any Rows where no value is returned in the Description column. I have tried some code on other forums but it appears that because I have a formula in the description column it doesnt recognise it as blank. This is the formula I use for description =IFERROR(INDEX(tb_Master_table[Sub Category],MATCH(A22,tb_Master_table,0)),"")

So the idea would be that only rows from "code to A4" would be visible. All help greatly appreciated

<tbody>
</tbody>

CodeDescription
A1Accountant Fees
A2Legal Fees
A3Rent
A4Fixtures and fittings
A5
A6
A7
A8
A9
A10
A11
A12
A13
A14

<tbody>
</tbody>
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi,

I believe this is the code you are looking for:

Code:
Sub Macro2()    Dim x As Integer
    Dim y As Integer
    
    y = 50
    
    For x = 1 To y
    
    If Cells(x, 1).Value = "" Then
    
    Rows(x).EntireRow.Hidden = True


    End If
    
    Next x
    
End Sub

Best Regards,
Mart
 
Last edited:
Upvote 0
Thanks Mart, so i want any row with a "" value in column B to be hidden, however when i run this code it doesnt hide the rows in the column that have a formula in it? even though the results of the formulas return a "" value
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,176
Members
448,554
Latest member
Gleisner2

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