ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Help with: ListBox1.AddItem (ws.Name) (https://www.excelbanter.com/excel-worksheet-functions/26722-re-help-listbox1-additem-ws-name.html)

Ron de Bruin May 18th 05 07:02 PM

Help with: ListBox1.AddItem (ws.Name)
Try this

It use the sheet index

Dim ws As Worksheet
Dim a As Integer
For a = 5 To ThisWorkbook.Worksheets.Count
ListBox1.AddItem Sheets(a).Name
Next a

Regards Ron de Bruin

"NightProbe" wrote in message ...
Using the following, how can I cause the result to return all but the
first four worksheet out of a 10 worksheets workbook?

Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ListBox1.AddItem (ws.Name)
Next ws

Best Regards

All times are GMT +1. The time now is 07:00 AM.

Powered by vBulletin® Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.