98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel Training and help » Auto Hiding a row in Excel
Auto Hiding a row in Excel
Resolved · 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
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.
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Pivot table groupingIf 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. |