ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing macro, selected rows only (https://www.excelbanter.com/excel-programming/424434-printing-macro-selected-rows-only.html)

Matt G[_2_]

Printing macro, selected rows only
 
Hi,

I have a macro to import a file and sort by column A and set a page break
each time the value on column A changes. Next I only want to print certain
rows on each page and I can't figure out how to do it.

For example, I only want to print row 2 if the value of cells P2 through U2
are all zero(invidually, not a sum) and the value of cell V2 is zero.

Any thoughts?



Don Guillett

Printing macro, selected rows only
 
Hide the rows not needed

Range("a1,a7,a10:a15").EntireRow.Hidden = True
'other code
Rows.Hidden = False
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Matt G" wrote in message
...
Hi,

I have a macro to import a file and sort by column A and set a page break
each time the value on column A changes. Next I only want to print
certain
rows on each page and I can't figure out how to do it.

For example, I only want to print row 2 if the value of cells P2 through
U2
are all zero(invidually, not a sum) and the value of cell V2 is zero.

Any thoughts?




Matt G[_2_]

Printing macro, selected rows only
 
Hi Don,

It is hiding the rows listed but I need it to hide rows based on the values
of the cells below. I'm fairly new at this so maybe I'm missing something.
The 'other code I assumed was the "sheets.printout" commands. Where am I
going wrong?

"Don Guillett" wrote:

Hide the rows not needed

Range("a1,a7,a10:a15").EntireRow.Hidden = True
'other code
Rows.Hidden = False
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Matt G" wrote in message
...
Hi,

I have a macro to import a file and sort by column A and set a page break
each time the value on column A changes. Next I only want to print
certain
rows on each page and I can't figure out how to do it.

For example, I only want to print row 2 if the value of cells P2 through
U2
are all zero(invidually, not a sum) and the value of cell V2 is zero.

Any thoughts?





Don Guillett

Printing macro, selected rows only
 

If desired, send your wb to my address below along with this msg,
explanation, and before/after example
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Matt G" wrote in message
...
Hi Don,

It is hiding the rows listed but I need it to hide rows based on the
values
of the cells below. I'm fairly new at this so maybe I'm missing
something.
The 'other code I assumed was the "sheets.printout" commands. Where am I
going wrong?

"Don Guillett" wrote:

Hide the rows not needed

Range("a1,a7,a10:a15").EntireRow.Hidden = True
'other code
Rows.Hidden = False
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Matt G" wrote in message
...
Hi,

I have a macro to import a file and sort by column A and set a page
break
each time the value on column A changes. Next I only want to print
certain
rows on each page and I can't figure out how to do it.

For example, I only want to print row 2 if the value of cells P2
through
U2
are all zero(invidually, not a sum) and the value of cell V2 is zero.

Any thoughts?







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

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