Hi - I am getting a "Compile error: Expected Array" for the below code:
I feel like there is a simple thing I am missing, but can't figure it out. Any help is appreciated. Thanks![]()
Sub ListSheetsinArray() 'List Sheets into an array Dim SheetArray As Integer Dim sCount As Integer Dim i As Integer sCount = Sheets.Count ReDim SheetArray(1 To sCount) As Integer For i = 1 To UBound(SheetArray) Cells(i, 1) = Sheets(i).Name Next i End Sub
Bookmarks