View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
OJ[_2_] OJ[_2_] is offline
external usenet poster
 
Posts: 111
Default Selecting worksheets into groups?

Hi,
try declaring a variable like this

Dim intInc as Long, intCnt as Long, Sheets4Printing() as Long

For intCnt = 1 to ThisWorkbook.Sheets.Count
'''Code to determine whether the sheet is added or not
redim Preserve Sheets4Printing(intInc)
Sheets4Printing(intInc) = Sheets(intCnt).Index
intInc = intInc + 1
Next
Sheets(Sheets4Printing).Select

This adds the sheet indexes to an array which can then be used...
Hth,
OJ