thanks for helping...
i was given this code some time ago and it works great...
At the time i needed to then sort the printing through several ranges...
and was given this, i changed teh ranges and used it 10 times is a workbook
and it works great too...
and i use that PrintSome about 10 times.......
OK, here is my problem
i am building the same workbook for an other new customer
and the printing is just not working
there is a Compile Error: "Sub or function not defined"
i think my problem is in the second to the last line
in the first code where is states....
"wsToPrint(2, Max) = -9.9E+101"
because of the number of pages, i am guessing at the problem
the first worksheet that should print is the 12th
and there is a total of 71 worksheets to look through
this code works great in one work book but not the new one i am making
i need to print.....
sorted by cell F7, from highest to lowest number
with in a rage of worksheets
if there is a value ( any value ) in cell B8
i thought this would be an easy copy and paste into this new work book
( everything else was )
thanks for your help as always
Thomas
i was given this code some time ago and it works great...
PHP:
Sub sortedPrint()
Dim ws As Worksheet
Dim wsToPrint() As Double
Dim pCount As Integer
Dim i As Integer
Dim j As Integer
Dim Max As Integer
i = 1
For Each ws In Worksheets
If ws.Range("B8").Value <> "" Then
ReDim Preserve wsToPrint(1 To 2, 1 To i)
wsToPrint(1, i) = ws.Index
wsToPrint(2, i) = ws.Range("F7").Value
i = i + 1
End If
Next ws
pCount = UBound(wsToPrint, 2)
For i = 1 To pCount
Max = 1
For j = 1 To pCount
If wsToPrint(2, j) > wsToPrint(2, Max) Then Max = j
Next j
Sheets(wsToPrint(1, Max)).PrintOut
wsToPrint(2, Max) = -9.9E+101
Next i
End Sub
At the time i needed to then sort the printing through several ranges...
and was given this, i changed teh ranges and used it 10 times is a workbook
and it works great too...
PHP:
Sub printSome1()
sortedPrintFromTo "sheet1", "sheet8"
End Sub
Sub printSome2()
sortedPrintFromTo "sheet10", "Wtrcarr28"
End Sub
and i use that PrintSome about 10 times.......
OK, here is my problem
i am building the same workbook for an other new customer
and the printing is just not working
there is a Compile Error: "Sub or function not defined"
i think my problem is in the second to the last line
in the first code where is states....
"wsToPrint(2, Max) = -9.9E+101"
because of the number of pages, i am guessing at the problem
the first worksheet that should print is the 12th
and there is a total of 71 worksheets to look through
this code works great in one work book but not the new one i am making
i need to print.....
sorted by cell F7, from highest to lowest number
with in a rage of worksheets
if there is a value ( any value ) in cell B8
i thought this would be an easy copy and paste into this new work book
( everything else was )
thanks for your help as always
Thomas