How to Store Each Sheet Name in an Array with VBA Macro
Sub ShtNamesIntoArray()
Dim SheetNames() As String
ReDim SheetNames(1 To ActiveWorkbook.Sheets.Count) ' Resizing Array
For X = 1 To Sheets.Count
SheetNames(X) = Sheets(X).Name
Next X
'To display the sheet name First Column of Active Sheet
For X = 1 To Sheets.Count
ActiveSheet.Cells(X, 1) = SheetNames(X)
Next X
End Sub
Sub ShtNamesIntoArray()
Dim SheetNames() As String
ReDim SheetNames(1 To ActiveWorkbook.Sheets.Count) ' Resizing Array
For X = 1 To Sheets.Count
SheetNames(X) = Sheets(X).Name
Next X
'To display the sheet name First Column of Active Sheet
For X = 1 To Sheets.Count
ActiveSheet.Cells(X, 1) = SheetNames(X)
Next X
End Sub
To Understand More about Arrays , go through the below Link :
Thanks, TAMATAM
No comments:
Post a Comment
Hi User, Thank You for visiting My Blog. Please post your genuine Feedback or comments only related to this Blog Posts. Please do not post any Spam comments or Advertising kind of comments which will be Ignored.