Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Code to select print out areas

Hi all,

I have a spreadsheet with about 200 rows.Each row has formulas. Is there a
way to do a code that only print out the areas containing a value (numbers)
in these areas, and not if itīs only formulas.

What can I say, I want a button, and when I press that button the areas
that are printed are the oneīs containing the numbers.
That means that the code has to have the properties to increase or decrease
the area depending whether there are numbers or not.


Example:

A Return
3 1000 Print row=YES
4 Formula Print row=NO
5 3000 Print=rowYES

7 Formula Print row=NO
8 4000 Print=rowYES
9 Formula Print row=NO

...............and so on

Thanks,

Thomas


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Code to select print out areas

you would have to loop through your rows and hide them based on the value in
the formula

If they produce a number or text. you could do

On error Resume NExt
set rng = Columns(1).SpecialCells(xlformulas,xlTextValues)
On error goto 0
if not rng is nothing then
rng.EntireRow.Hidden = True
Activesheet.Printout
End if

--
Regards,
Tom Ogilvy

"Jonsson" wrote in message
...
Hi all,

I have a spreadsheet with about 200 rows.Each row has formulas. Is there a
way to do a code that only print out the areas containing a value

(numbers)
in these areas, and not if itīs only formulas.

What can I say, I want a button, and when I press that button the areas
that are printed are the oneīs containing the numbers.
That means that the code has to have the properties to increase or

decrease
the area depending whether there are numbers or not.


Example:

A Return
3 1000 Print row=YES
4 Formula Print row=NO
5 3000 Print=rowYES

7 Formula Print row=NO
8 4000 Print=rowYES
9 Formula Print row=NO

..............and so on

Thanks,

Thomas




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I print multiple print areas on one page Leo18 Excel Discussion (Misc queries) 1 January 11th 10 07:28 PM
Can I adjust print scaling for multiple print areas on the same sh N. Sammons Excel Discussion (Misc queries) 0 June 18th 08 10:24 PM
How to select multiple areas with keyboard only Rotaluclac Excel Discussion (Misc queries) 2 June 6th 08 10:07 PM
Need to print a workbook but worksheets have diff print areas Angela Steele Excel Discussion (Misc queries) 1 January 17th 08 07:39 PM
Code modification to accomodate scaling and print areas. Phil Hageman[_3_] Excel Programming 2 February 26th 04 02:06 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Đ2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"