Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88809

I get problems creating a collection in Excel VBA

$
0
0

In the VBA Editor, I have created a new collection of worksheets with the following code:

Set Page1s = New Collection
Page1s.Add Workbook010.Sheets("1stPage")

For now, I've got only one worksheet in this collection that I'd like to copy with the following code

Workbook010.Page1s(1).Copy After:=Sheets("1stPage")

The here above line of code generate a Run-Time Error 9, Subscript out of Range... I don't understand why can't I reach the first item of the collection that I have just created? I thank you very much in advance for your feedback. Franz


Viewing all articles
Browse latest Browse all 88809

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>