For Each sh In Workbooks("Addins.Names v2.xls").Worksheets
i = i + 1
Cells(i, 1).Value = sh.Name
Next sh
In which case the 'i = 0' statement may be unnecessary if i were an as-yet
unused integer. As an added bonus, i equals the number of entries after the loop
completes. But the count already exists, so why not use it?
For i = 1 To Workbooks("Addins.Names v2.xls").Worksheets.Count
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.