Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

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

ResolvedVersion 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:

Shortcut for accessing recently opened files

To get into recently opened Excel files without using your mouse, hold down Alt + F to open the File menu.

Recently opened files are listed down the bottom of the File menu - type in the number next to the file you wish to open and it should appear on your screen.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.