auto hiding row excel

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Auto Hiding a row in Excel

Auto Hiding a row in Excel

resolvedResolved · Urgent Priority · Version 2010

Lisa has attended:
Excel Intermediate course
Excel Advanced course

Auto Hiding a row in Excel

Hi

I'm trying to use VBA to autohide rows when a cell value is returned as false.

THe cells that false is being returned in are R4:R1500.

Can you advise?

Thanks

Edited on Wed 12 Feb 2014, 15:23

RE: Auto Hiding a row in Excel

Hi Lisa

One way to hide rows containing FALSE is to use Data, Filter.

Here is an example with 3 column headings
P..........Q.......R

Grade Status Result
A........1........OK
B........1........OK
B........2........FALSE
A........1........OK
B........3........FALSE

Result is OK if Grade="A" or Status=1
Otherwise Result is FALSE

Formula:
=IF(OR(P4="A",Q4=1),"OK")

Here is a macro called HideFalse to carry out this Autofilter

Sub HideFalse()

Range("R3").Select
Selection.AutoFilter
ActiveSheet.Range("R3").CurrentRegion.AutoFilter Field:=3, Criteria1:="<>FALSE"
End Sub

In your case Field:=3 will be the position of your R column within your data. (eg if R is the 10th column then change to Field:=10)

Hope that help?

Regards
Doug Dunn
Best STL

Wed 19 Feb 2014: Automatically marked as resolved.


 

Excel tip:

Pivot table grouping

If you want to group items in a pivot table together, simply highlight the labels for the fields either with the shift key (if adjacent)or with the contral key if they are not next to each other.
Right click and choose group. Give the cell a name.

When you double click on this cell it will either expamd or collapse your grouped area

View all Excel hints and tips


Server loaded in 0.06 secs.