Hello again
I've got it working now. It's not as elegant as your suggestion, but you definately gave me some good clues on getting it done
I ended up adding one "fillcells" to the previous "fillcells" for each worksheet range
Here's the (incomplete) code in case anyone reading this thread has suggestions for improvement
Option Explici
Sub PrintDataWkShts(
' PrintDataWkShts Macr
' Keyboard Shortcut: Ctrl+
Dim rng As Rang
Dim fillcells As Intege
Sheets("Basic Pricing").Selec
Set rng = ActiveSheet.Range("D131

176"
fillcells = Application.WorksheetFunction.CountA(rng
Set rng = ActiveSheet.Range("I131:I176"
fillcells = Application.WorksheetFunction.CountA(rng) + fillcell
If fillcells > 0 The
ActiveSheet.PrintOu
End I
fillcells =
Sheets("Quick Price Sections").Selec
Set rng = ActiveSheet.Range("D17

72"
fillcells = WorksheetFunction.CountA(rng
If fillcells > 0 The
ActiveSheet.PrintOu
End I
fillcells =
Sheets("Quick Price Accessories").Selec
Set rng = ActiveSheet.Range("P17

78"
fillcells = WorksheetFunction.CountA(rng
If fillcells > 0 The
ActiveSheet.PrintOu
End I
Sheets("Accessories Area (1)").Selec
Range("C130:I190").Selec
Sheets("Accessories Area (2)").Selec
Range("C130:I190").Selec
Sheets("Accessories Area (3)").Selec
Range("C130:I190").Selec
Sheets("Accessories Area (4)").Selec
Range("C130:I190").Selec
Sheets("Basic Pricing").Selec
Range("D3").Activat
End Su
Thanks again for your help
rp
----- rpw wrote: ----
Hi Frank
Thanks for your input. I looked up and tested the 'CountA' function and it counts even formulas (at least in a cell formula). This makes a generic range for each sheet not workable for me. So it looks like I'm going to have to list each worksheet and their ranges separately in the code. However, while attempting to do that I ran into another problem. Some of the sheets have multiple ranges. How do you get multiple ranges
I've tried: ("A1:A70"), ("D1

70"
("A1:A70", "D1

70"
("A1:A70" + "D1

70"
("A1:A70") +("D1

70"
("A1:A70, D1

70"
and get compile errors
Hmmm, as I'm writing this I'm thinking that the variable 'rng' could be set to the first range and then set again to the second range plus rng........ Nope, tried it and that doesn't work
So, how do I get it to look at multiple ranges on a single worksheet
Thanks again for taking the time to help
rp
----- Frank Kabel wrote: ----
H
try something like the following (not tested though
sub print_i
dim wks as workshee
dim rng as rang
dim fillcell
for each wks in worksheet
set rng=wks.range("A1:S1000"
fillcells=application.worksheetfunction.countA(rng
if fillcells>0 the
wks.printou
end i
nex
end su
-
Regard
Frank Kabe
Frankfurt, German
rpw said:
Ummm, being sort of impatient I went and started a macro that select
the various worksheets and ranges in the order I want. So it look
like the next step is to determine if there's any data in the range
How do I do that
' PrintDataWkShts Macr
' Macro recorded 5/26/2004 by rp
' Keyboard Shortcut: Ctrl+
Sheets("Basic Pricing").Selec
Range("D131

176").Selec
Range("I131:I176").Select
Range("N131:N176").Select
Range("S131:S176").Select
Sheets("Quick Price Sections").Select
Range("Y17:Y72").Select
Sheets("Quick Price Accessories").Select
Range("P17

78").Select
Sheets("Accessories Area (1)").Select
Range("C130:I190").Select
Sheets("Accessories Area (2)").Select
Range("C130:I190").Select
Sheets("Accessories Area (3)").Select
Range("C130:I190").Select
Sheets("Accessories Area (4)").Select
Range("C130:I190").Select
Sheets("Basic Pricing").Select
Range("D3").Activate
End Sub
know where to edit it, and I've learned how to modify generic code so
it matches my applications, but when it comes to actually creating it,
I'm really lacking in skill. If you have a solution you could post
that'd be great. On the other hand, if you'd like to take the time to
'guide' me through the process, I do have an idea of what needs to
happen.then maybe place a control on the main worksheet that runs the module.
I guess the module code would then make each worksheet active, search a
defined range for anything other than blanks, print the page if there's
data, skip the printing if there's no data, and go to the next
worksheet and run through the cycle again?
TIA
rpw
----- Frank Kabel wrote: -----
Hi not possible without VBA
--
Regards
Frank Kabel
Frankfurt, Germany