Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can just call Bob's code the same as any other code. If you wish you can
even change the word function to sub. The only not is that the sheet Apple must come before the sheet Orange and none of the sheets in the middle may be hidden... sub Test Call GroupSheets("Apple", "Orange") end sub Public Sub GroupSheets(StartSheet As String, EndSheet As String) Dim iStart As Long Dim iEnd As Long Dim i As Long, j As Long Dim arySheets On Error Resume Next iStart = ActiveWorkbook.Worksheets(StartSheet).Index iEnd = ActiveWorkbook.Worksheets(EndSheet).Index On Error GoTo 0 If iStart = 0 Or iEnd = 0 Or iEnd < iStart Then MsgBox "Invalid" Exit Function End If ReDim arySheets(iEnd - iStart) For i = iStart To iEnd arySheets(i - iStart) = ActiveWorkbook.Worksheets(i).Name Next i Sheets(arySheets).Select End Sub -- HTH... Jim Thomlinson "J.W. Aldridge" wrote: I'm sure it will work, but I'm having some trouble figuring out where to place a function. I'm used to sub - macro's. Should there be a heading? As stated before, I will add-in the procedures I need towards the end. Thanx. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Name a group of sheets | Excel Discussion (Misc queries) | |||
sort between a group of sheets | Excel Worksheet Functions | |||
Group Sheets | Excel Discussion (Misc queries) | |||
Need group all sheets in a workbook | Excel Programming | |||
Sheets Protection for group!!!!? | Excel Programming |