ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Printing only Rows with a value in a specific column (https://www.excelbanter.com/excel-discussion-misc-queries/102946-printing-only-rows-value-specific-column.html)

Eric

Printing only Rows with a value in a specific column
 
I have several rows of info but i would only like to print rows with a value
in a certain column. Any Ideas

Ron de Bruin

Printing only Rows with a value in a specific column
 
See this page for a macro solution
http://www.rondebruin.nl/print.htm

You can use this for example for column A in Sheet1
read the info on my site first

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "Sheet1" Then
Cancel = True
Application.EnableEvents = False
Application.ScreenUpdating = False
With ActiveSheet
On Error Resume Next
.Columns("A").SpecialCells(xlCellTypeBlanks).Entir eRow.Hidden = True
.PrintOut
.Columns("A").SpecialCells(xlCellTypeBlanks).Entir eRow.Hidden = False
On Error GoTo 0
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Eric" wrote in message ...
I have several rows of info but i would only like to print rows with a value
in a certain column. Any Ideas




David Biddulph

Printing only Rows with a value in a specific column
 
"Eric" wrote in message
...
I have several rows of info but i would only like to print rows with a
value
in a certain column. Any Ideas


Autofilter
--
David Biddulph




All times are GMT +1. The time now is 02:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com