ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA to create an Array of all Sheets in workbook (https://www.excelbanter.com/excel-programming/287553-vba-create-array-all-sheets-workbook.html)

Guy Hoffman[_3_]

VBA to create an Array of all Sheets in workbook
 
Need some code to create an array called MySheets that includes al
sheet names in the workbook.

I'm then going to use the array in the following formula:

Number
SUMPRODUCT(COUNTIF(INDIRECT("'"&MySheets&"'!"&CELL ("address",A1)),"0"))


Likely would use a For Next construct to cycle through the sheets bu
I'm stuck.

Thank

--
Message posted from http://www.ExcelForum.com


Kieran[_23_]

VBA to create an Array of all Sheets in workbook
 
Guy,

Chip Pearson covers thsi quite well at
http://www.cpearson.com/excel/excelM.htm#SheetNames


---
Message posted from http://www.ExcelForum.com/


Guy Hoffman[_4_]

VBA to create an Array of all Sheets in workbook
 
Thank you. I feel very silly

--
Message posted from http://www.ExcelForum.com


Dave Peterson[_3_]

VBA to create an Array of all Sheets in workbook
 
See one more reply at your other post.


"Guy Hoffman <" wrote:

Need some code to create an array called MySheets that includes all
sheet names in the workbook.

I'm then going to use the array in the following formula:

Number =
SUMPRODUCT(COUNTIF(INDIRECT("'"&MySheets&"'!"&CELL ("address",A1)),"0"))

Likely would use a For Next construct to cycle through the sheets but
I'm stuck.

Thanks

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson



All times are GMT +1. The time now is 11:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com