I am trying to select a range of sheets of my workbook between the "Sheet 3" and "Last Sheet-2". For this, I have this formula:
Code:
Sheets(Array("Sheet3", "Sheet4", "Sheet5", Sheet6")).select
Knowing that the number of sheets is variable, Here is my code with a small loop:
Code:
Dim strRange As String
strRange = "Sheets(Array("
For i = 3 To Sheets.Count - 2
If i > 3 Then strRange = strRange & ","
strRange = strRange & Chr(34) & Sheets(i).Name & Chr(34)
Next i
strRange = strRange & " )).select"
Problem: any fool can solve in 5 min I think. I have 98% of that
=> I am simply trying to execute "strRange" but I have a mega hole to do this.
When I test my formula through
It brings me back well
Code:
Sheets(Array("Sheet3", "Sheet4", "Sheet5", Sheet6" )).select
Can be that string is not the right variable to use?
Bookmarks