ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Array with excel sheet inside (need 2 code rows please) (https://www.excelbanter.com/excel-programming/448883-array-excel-sheet-inside-need-2-code-rows-please.html)

[email protected]

Array with excel sheet inside (need 2 code rows please)
 
Hi,
I need two-three code rows...
I'd like to define an array and put inside all the name of the sheet included in the excel file.

I need also one row to understand how can I take these data included in the array.
Thanks.

[email protected]

Array with excel sheet inside (need 2 code rows please)
 
Il giorno venerd́ 14 giugno 2013 09:05:57 UTC+2, ha scritto:
Hi, I need two-three code rows... I'd like to define an array and put inside all the name of the sheet included in the excel file. I need also one row to understand how can I take these data included in the array. Thanks.



I'm blocked because I can't add the sheet name into the array.
What's wrong in this code?.

Dim Vettore() As Variant
For loopInt = 1 To Worksheets.Count
Vettore = Worksheets(loopInt).Name
Next

Claus Busch

Array with excel sheet inside (need 2 code rows please)
 
Ciao,

Am Fri, 14 Jun 2013 06:42:21 -0700 (PDT) schrieb :

Dim Vettore() As Variant
For loopInt = 1 To Worksheets.Count
Vettore = Worksheets(loopInt).Name
Next


try:
Sub Test()
Dim Vettore() As Variant
Dim loopint As Integer

ReDim Vettore(Sheets.Count - 1)
For loopint = 0 To Worksheets.Count - 1
Vettore(loopint) = Sheets(loopint + 1).Name
Next
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

[email protected]

Array with excel sheet inside (need 2 code rows please)
 
Il giorno venerd́ 14 giugno 2013 09:05:57 UTC+2, ha scritto:
Hi, I need two-three code rows... I'd like to define an array and put inside all the name of the sheet included in the excel file. I need also one row to understand how can I take these data included in the array. Thanks.


thank you.


All times are GMT +1. The time now is 04:38 AM.

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