lookup for bright solution...
thanks for concerned reply,
it works well in grouping *ALL* the sheets of the workbook based on criteria
A10=0
1) is it possible that i first select *SOME* of the adjacent sheets that
shall be grouped and then run the macro..then the macro will refine the
selection of my Group with A10=0.
2) i need to preserve the sheet numbering from left to right in order to
trace which sheettabs has A10<0..meaning after running the macro..and i
print preview [or print to file] the refined group, then i can see my RIGHT
SIDE footer*&[Page] OF &[Pages]* in accordance to the real sequence of *ALL*
the sheets that i selected before running the macro..
If i have 10 sheets, and select only the next 9 contiguous sheets for the
group.
so if the 9 sheets have A10=0, the &[PAGES] will be 9.
and also
If i have 10 sheets, and select only the next 9 contiguous sheets for the
group.
and if there are 5 non-adjacent sheets with A10<0, the &[PAGES] will also
be 9 and the &[PAGE] field will be based on the arrangement of the 9 sheets...
I am also not allowed to move the position of sheet tabs in this workbook.
i believe its possible with your help to complete this.
thanks and regards,
driller
--
*****
birds of the same feather flock together..
"Dave Peterson" wrote:
Maybe something like:
Option Explicit
Sub testme()
Dim wCtr As Long
Dim ArrNames() As String
Dim iCtr As Long
Dim myAddr As String
myAddr = "A10"
ReDim ArrNames(1 To Worksheets.Count)
iCtr = 0
For wCtr = 1 To Worksheets.Count
With Worksheets(wCtr)
With .Range(myAddr)
If IsNumeric(.Value) Then
If .Value = 0 Then
'add it
iCtr = iCtr + 1
ArrNames(iCtr) = .Parent.Name
End If
End If
End With
End With
Next wCtr
If iCtr 0 Then
'found at least one
'resize the array
ReDim Preserve ArrNames(1 To iCtr)
Worksheets(ArrNames).PrintOut preview:=True
End If
End Sub
driller wrote:
hello again,
i have posted these before in other forum..i forget that this may be a
little complicated in this forum...
in myWorkbook i have many sheets,
the sheet names has no typical name pattern
is it possible to print the group of sheets in one command under a typical
criteria.
that is, *print the sheet if cell A1=0*, yet the footer page numbers must be
maintained.
If the there are 30 sheets in the grouptab, while 10 sheets contains *A10*,
then only sheets will be printed.
The footer paging SEQUENCE numbers shall correspond to the arrangement of
the sheets (L to R) in the workbook regardless of the above criteria....
hope its simple.<saving trees!
regards,
driller
--
*****
birds of the same feather flock together..
--
Dave Peterson
|