Grouping Worksheets : Worksheets « Excel « VBA / Excel / Access / Word






Grouping Worksheets

 
     Sub GroupSheets()
         Dim asNames(1 To 3) As String
         Dim i As Integer

         asNames(1) = "Jan 2007"
         asNames(2) = "Mar 2007"
         asNames(3) = "May 2007"

         Worksheets(asNames(1)).Select

         For i = 2 To 3
         Worksheets(asNames(i)).Select Replace:=False
         Next i

     End Sub

 








Related examples in the same category

1.Do... Loop Until Loops with Worksheets
2.Looping Through Worksheets in a Workbook
3.move the second worksheet to end of workbook
4.performs a simple bubble sort to sort the worksheets in the workbook
5.For...Next Loop with Worksheet
6.The Sheets Collection
7.Dynamic Arrays for worksheet name
8.Use for loop to loop through all worksheets
9.Sort all worksheets