Dim Arr() As String
Dim i As Integer
ReDim Arr(Sheets.Count - 1)
For i = 0 To Sheets.Count - 1
Arr(i) = Sheets(i + 1).Name
Next i
Sheets(Arr).Select
Sub SelectAllSheets()
Dim MyArray() As Integer, i As Integer
ReDim MyArray(1 To Sheets.Count)
For i = 1 To Sheets.Count
MyArray(i) = i
Next i
Sheets(MyArray).Select
End Sub
And with this mind,parry said:Sheets property also accepts numbers as well as Sheet names
NateO said:And with this mind,parry said:Sheets property also accepts numbers as well as Sheet names
<font face=Courier New><SPAN style="color:darkblue">Sub</SPAN> test()
Sheets(Evaluate("transpose(row(1:" & Sheets.Count & _
"))")).<SPAN style="color:darkblue">Select</SPAN>
<SPAN style="color:darkblue">End</SPAN> <SPAN style="color:darkblue">Sub</SPAN></FONT>
Sub testIt()
ActiveWorkbook.Sheets.Select
End Sub
Jonbob said:I have 200 worksheets in a workbook. What macro is there to select all worksheets?
Thanks,
Jonbob