Solved

Excel: Macro to Hide Rows Based on Column Value

Posted on 2014-09-24
2
605 Views
Last Modified: 2014-09-25
Hello,

Seeking help to code a macro that when activated will

1. Hide rows 10-29 if a value in column AB says 'Hide'

E.g if AB10 says 'Hide' - then row 10.

2. Print the sheet

3. Unhide rows 10-29 (regardless of the AB column values).

What's the best way of doing this?

Cheers.
0
Comment
Question by:dabug80
2 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40343397
Sub HidenThenPrint()
For introw = 10 To 29
    If Cells(introw, 28) = "Hide" Then
        Rows(introw).Hidden = True
    End If
Next
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
Rows("10:29").EntireRow.Hidden = False
End Sub

Open in new window

0
 
LVL 1

Author Closing Comment

by:dabug80
ID: 40345173
Great. Thanks for your help
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now