Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default VBA IF FUNCTIONS WITH PRINT RANGE

I have a sheet that has 16 different tables. Each table has 1 value, it is
either zero, or a number greater than zero. If it is greater than zero then I
need the table or tables to print out. I am familiar with macros and buttons,
but how do I do the if function and print range through vba. I can send the
spreadsheet for better understanding if you need me to.


thanks,

Hamed Parhizkar
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default VBA IF FUNCTIONS WITH PRINT RANGE

the basic code would be:

IF Range("table1") 0 then
.... (place the code necessary to print the range here)
End IF

In this example table1 represents the cell where the value of the first
table is found. you could replace this with Range("A1")

Cheers,
Shane

"Hamed parhizkar" wrote in
message ...
I have a sheet that has 16 different tables. Each table has 1 value, it is
either zero, or a number greater than zero. If it is greater than zero
then I
need the table or tables to print out. I am familiar with macros and
buttons,
but how do I do the if function and print range through vba. I can send
the
spreadsheet for better understanding if you need me to.


thanks,

Hamed Parhizkar


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default VBA IF FUNCTIONS WITH PRINT RANGE

Here is what I have in and it worked but the tables that were zero still
printed??? What am I doing wrong???

If Range("C28") 0 Then Range("A23:D34").Select
ActiveSheet.PageSetup.PrintArea = "$A$23:$D$34"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

"Shane Devenshire" wrote:

the basic code would be:

IF Range("table1") 0 then
.... (place the code necessary to print the range here)
End IF

In this example table1 represents the cell where the value of the first
table is found. you could replace this with Range("A1")

Cheers,
Shane

"Hamed parhizkar" wrote in
message ...
I have a sheet that has 16 different tables. Each table has 1 value, it is
either zero, or a number greater than zero. If it is greater than zero
then I
need the table or tables to print out. I am familiar with macros and
buttons,
but how do I do the if function and print range through vba. I can send
the
spreadsheet for better understanding if you need me to.


thanks,

Hamed Parhizkar



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
excel spreadsheet print functions [email protected] Excel Worksheet Functions 1 May 5th 07 12:16 AM
Print Blank Pgs - Preview margins outside print range dsm Excel Discussion (Misc queries) 0 October 25th 06 06:17 PM
excel print functions jatman Excel Programming 1 March 22nd 06 08:23 PM
How to print detailed instructions for all functions in Excel? clark Excel Worksheet Functions 1 August 25th 05 10:47 AM
How can I print out a list of statistical functions in Excel (I d. pegberger Excel Worksheet Functions 1 January 5th 05 10:12 PM


All times are GMT +1. The time now is 02:14 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"