Sunday, July 6, 2014

Excel VBA Macro to Store Each Sheet Name in an Array

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

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.

Featured Post from this Blog

How to compare Current Snapshot Data with Previous Snapshot in Power BI

How to Dynamically compare two Snapshots Data in Power BI Scenario: Suppose, we have a sample Sales data, which is stored with Monthly Snaps...

Popular Posts from this Blog