Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
cb cb is offline
external usenet poster
 
Posts: 2
Default macro printing question

HI-
I have a macro set up to print a series of different
ranges on several different worksheets within a single
workbook.
My problem:

In several places, if a specific cell=0, I want the macro
to skip the next print range and go onto the next.
Can I add that somehow to the macro?? and if so, how
would I do that??

Any help would be SO appreciated - thanks in advance.
cindy
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro printing question

Of course you'll need to edit to suit but this should point you in th
right direction


Sub PrintNeededSpreadsheets()

Sheets("Sheet1").Select
if Range("A1").value < "0" then
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
end if

Sheets("Sheet2").Select
if range("A1").value < "0" then
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
end if

.....

End Sub


Jorda

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
cb cb is offline
external usenet poster
 
Posts: 2
Default macro printing question

Hi-
Thanks for replying - here is the macro... which actually
brings up another question.....

The first 2 worksheets print are OK.
On the "Social Serv" worksheet - I have 2 print ranges;
part 1 and part 2 -- I now have them both selected when I
set the print area, but what I need is this:
Print part 1
If cell K170=0
Do not print part 2

This same senario is true for the other 3 sheets. thanks
again for looking at this...

Sub newPrint()
'
' newPrint Macro
' Macro recorded 8/9/2004 by cindyb
'

'
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
Sheets("B").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
Sheets("SOCIAL SERV").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
Sheets("COMMIS").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
Sheets("AUDITOR").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
Sheets("PAYROLL").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
End Sub


-----Original Message-----
As always, you should post YOUR macro for comments.

--
Don Guillett
SalesAid Software

"cb" wrote in

message
...
HI-
I have a macro set up to print a series of different
ranges on several different worksheets within a single
workbook.
My problem:

In several places, if a specific cell=0, I want the

macro
to skip the next print range and go onto the next.
Can I add that somehow to the macro?? and if so, how
would I do that??

Any help would be SO appreciated - thanks in advance.
Cindy



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default macro printing question

something like this might work to not print the hidden rows

ActiveWindow.PrintOut

Sheets("B").PrintOut

with Sheets("SOCIAL SERV")
if .range("k170")=0 then .rows("3:23").hidden=true
..PrintOut
..rows("3:23").hidden=false
end with

--
Don Guillett
SalesAid Software

"cb" wrote in message
...
Hi-
Thanks for replying - here is the macro... which actually
brings up another question.....

The first 2 worksheets print are OK.
On the "Social Serv" worksheet - I have 2 print ranges;
part 1 and part 2 -- I now have them both selected when I
set the print area, but what I need is this:
Print part 1
If cell K170=0
Do not print part 2

This same senario is true for the other 3 sheets. thanks
again for looking at this...

Sub newPrint()
'
' newPrint Macro
' Macro recorded 8/9/2004 by cindyb
'

'
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
Sheets("B").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
Sheets("SOCIAL SERV").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
Sheets("COMMIS").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
Sheets("AUDITOR").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
Sheets("PAYROLL").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
End Sub


-----Original Message-----
As always, you should post YOUR macro for comments.

--
Don Guillett
SalesAid Software

"cb" wrote in

message
...
HI-
I have a macro set up to print a series of different
ranges on several different worksheets within a single
workbook.
My problem:

In several places, if a specific cell=0, I want the

macro
to skip the next print range and go onto the next.
Can I add that somehow to the macro?? and if so, how
would I do that??

Any help would be SO appreciated - thanks in advance.
Cindy



.



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
An IF question plus Printing Macro sahafi Excel Worksheet Functions 0 March 20th 08 03:33 PM
macro printing question Pete W. Excel Discussion (Misc queries) 1 January 9th 07 07:35 AM
Printing Question WLMPilot Excel Discussion (Misc queries) 4 August 16th 06 02:08 PM
Printing question jezzica85 Setting up and Configuration of Excel 1 March 4th 06 11:50 AM
Question about printing lesgold80 Excel Discussion (Misc queries) 6 February 4th 05 04:33 PM


All times are GMT +1. The time now is 01:43 AM.

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"