Dynamic Arrays for worksheet name : Worksheets « Excel « VBA / Excel / Access / Word






Dynamic Arrays for worksheet name

 
Option Base 1
Sub MySheets()
    Dim myArray() As String
    Dim myCount As Integer, NumShts As Integer
    
    NumShts = ActiveWorkbook.Worksheets.count
    ReDim myArray(1 To NumShts)
    
    For myCount = 1 To NumShts
        myArray(myCount) = ActiveWorkbook.Sheets(myCount).name
    Next myCount
    
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.Grouping Worksheets
8.Use for loop to loop through all worksheets
9.Sort all worksheets