3 replies
by myerj Accepted solution
by thumbsup2 Accepted solution
The following is from the built-in VB HELP:
[i]The SelectedSheets Property - Returns a Sheets collection that represents all the selected sheets in the specified window.
Example - This example displays a message if Sheet1 is selected in Book1.xls.
For Each sh In Workbooks("BOOK1.XLS").Windows(1).SelectedSheets
If sh.Name = "Sheet1" Then
MsgBox "Sheet1 is selected"
Exit For
End If
Next[/i]
Now, you can do the selection of multiple sheets using an array like this:
[i]Sub Several()
Worksheets(Array("Sheet1", "Sheet2", "Sheet4")).Select
End Sub[/i]
So, you should be able to figure out how to combine the SelectedSheets property with an array to determine which ones are actually selected.
If you need more help, post back and we'll dig further through the VB HELP with you.
---
by valcourtd Accepted solution
Sorry to jump in for a question of my own, but it is somewhat along the lines of what is being discussed here. Is there any way to create a dynamic array of sheets such that I would be able to reference them as: iArray(n) where n is the sheet's place in the array and iArray is the array of sheets?
Thanks
This discussion is closed to new replies.
Trending Software posts
Sort by Trending