VBA - Visual Basic for Applications
Actually you can list all worksheet names in a workbook using the object path Workbook.Worksheets(index).Name.
I needed to have the names as strings in a VBA.Collection, so I developed a little function collecting the names.
' @Author - Alexander Bolte
' @Change Date - 26.12.2013
' @Description - Creates a list of all sheet names in given workbook.
' @Param wrk - Excel workbook the sheet name collection should be created from.
' @Returns - VBA.Collection holding all sheet names from given Microsoft Excel workbook.
Public Function getSheetNamesFromWorkbook(ByRef wrk As Workbook) As VBA.Collection
Dim i As Integer
Dim sheetNames As New VBA.Collection
On Error GoTo errHandle:
For i = 1 To wrk.Worksheets.Count
If Err.Number <> 0 Then
Set getSheetNamesFromWorkbook = sheetNames
- Hits: 5431
Recently a collegue had to import a SharePoint list into Excel for automated processing.
Below you can find the source code that I provided him with as an example.
- Hits: 4695
This function copies used range of handed worksheet and replaces it with values only.
- Hits: 5307
Excel VBA Article Count: 30
This category will hold articles regarding developement in Excel VBA. It will serve as a wiki and an Excel VBA Framework for myself.
Some development tasks reoccur for every customer. Since I am a lazy bum it will be nice to have a central source where I can reuse source code from.
MS Office and VBA Article Count: 11
This category holds articles regarding general things in MS Office VBA independent from the MS Office application.
Power Point VBA Article Count: 1
Access VBA Article Count: 7
This category holds articles regarding Access VBA, but also general things I come accross Access and its usage in companies.
Access VBA DAO Article Count: 2
Page 8 of 17