Auto hide fields using macros in MVB

Fmedia

New Member
Joined
Oct 10, 2006
Messages
7
Hi

I am in urgent need of some expert advice. I have a spreadsheet file that has several other dependencies, and looks very messy, as a lot of the cells are redundant (with FALSE in the cell because they are irrellevant). What I want to do is automatically hide any rows with 'false' in it. I have created in Microsoft Visual the following Macro:

Sub HideRows()

If Sheets("Sheet2").Range("A13").Value = False Then
Sheets("Sheet2").Range("A13").Select
Selection.EntireRow.Hidden = True
End If

End Sub

This works for what I want it to do, however is specific to one row (ie a13). When I want it to remove all false cells the macro wont work. I have tried the range "A:A", "A,A" and several more but to no avail. Can anybody help.
Many Thanks
Jonathan
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi,
Thanks for responding.

yes, col A is the master field so 'false' will always return in here if not relevant.

Jonathan
 
Upvote 0
Dim c As Range, rng
Set rng = Range("a1:a30")
For Each c In rng
If c.Value = "False" Then
c.EntireRow.Hidden = True
End If
Next c
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

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