ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Loading Sheet Index number into array (https://www.excelbanter.com/excel-programming/386375-loading-sheet-index-number-into-array.html)

ExcelMonkey

Loading Sheet Index number into array
 
I have an array that I want to load sheet index numbers into. The idea being
to load the VBA name of the sheet into the array with the intent of
extracting the excel version of the sheet later. So say in the VBA project
windows it says:

Sheet3 (inputs)

How to I load the text value of the VBA name. For example I want the fist
element of the array to say "Sheet(3)".

Then what I want to do is is I want to extract the actuual excel sheet name
"Input" from the index:

Sub ExtractSheetName ()
Dim Sheetcount As Integer
Dim SheetName As String

For Sheetcount = 1 To B
SheetName = ?
Debut.Print SheetName

Next

End Sub

ExcelMonkey

Loading Sheet Index number into array
 
Ok I know how to extract the VBA name:

InputSheetArray(0) = Sheet3.CodeName

But how do I extract the Excel Name from this?


Thanks

EM

"ExcelMonkey" wrote:

I have an array that I want to load sheet index numbers into. The idea being
to load the VBA name of the sheet into the array with the intent of
extracting the excel version of the sheet later. So say in the VBA project
windows it says:

Sheet3 (inputs)

How to I load the text value of the VBA name. For example I want the fist
element of the array to say "Sheet(3)".

Then what I want to do is is I want to extract the actuual excel sheet name
"Input" from the index:

Sub ExtractSheetName ()
Dim Sheetcount As Integer
Dim SheetName As String

For Sheetcount = 1 To B
SheetName = ?
Debut.Print SheetName

Next

End Sub


NickHK

Loading Sheet Index number into array
 

?sheet3.Name
Sheet3

NickHK

"ExcelMonkey" wrote in message
...
Ok I know how to extract the VBA name:

InputSheetArray(0) = Sheet3.CodeName

But how do I extract the Excel Name from this?


Thanks

EM

"ExcelMonkey" wrote:

I have an array that I want to load sheet index numbers into. The idea

being
to load the VBA name of the sheet into the array with the intent of
extracting the excel version of the sheet later. So say in the VBA

project
windows it says:

Sheet3 (inputs)

How to I load the text value of the VBA name. For example I want the

fist
element of the array to say "Sheet(3)".

Then what I want to do is is I want to extract the actuual excel sheet

name
"Input" from the index:

Sub ExtractSheetName ()
Dim Sheetcount As Integer
Dim SheetName As String

For Sheetcount = 1 To B
SheetName = ?
Debut.Print SheetName

Next

End Sub





All times are GMT +1. The time now is 01:22 PM.

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