Excel VBA Macro: List All Sheet/Tab Names (From Another User Selected Workbook)

  Рет қаралды 4,188

greggowaffles

greggowaffles

Күн бұрын

Excel VBA Macro: List All Sheet/Tab Names (From Another User Selected Workbook). In this video, we go over how to prompt the user to select another excel file, and then list all of the sheet/tab names in that file.
Code (just realized I never used the "sheet_name" variable. that can be omitted):
Sub tab_names_from_another_wb()
Dim FilePicker As FileDialog
Dim mypath As String
Dim sheet_name As String
Dim sheet_count As Integer
Dim i As Integer
Dim ws As Worksheet
Application.ScreenUpdating = False
Set ws = ThisWorkbook.Sheets(1)
Set FilePicker = Application.FileDialog(msoFileDialogFilePicker)
With FilePicker
.Title = "Please Select a File"
.ButtonName = "Confirm"
.AllowMultiSelect = False
If .Show = -1 Then
mypath = .SelectedItems(1)
Else
End
End If
End With
ws.Cells.ClearContents
Workbooks.Open Filename:=mypath
sheet_count = Sheets.Count
For i = 1 To sheet_count
ws.Cells(i, 1) = Sheets(i).Name
Next i
ActiveWorkbook.Close savechanges:=False
Application.ScreenUpdating = True
End Sub
#ExcelVBA #ExcelMacro

Пікірлер: 3
@vitarathiel
@vitarathiel Жыл бұрын
hi @greggowaffles ... how to create list of sheets in the same workbook (horizontally & vertically) ?
@rabinshrestha9335
@rabinshrestha9335 2 жыл бұрын
Can we get Sheet Names along with their file path??
@artroman3599
@artroman3599 9 ай бұрын
Yes great idea!
Excel VBA Macro: List Time Last Saved (For All Files In Folder)
12:57
greggowaffles
Рет қаралды 1,4 М.
VBA to BROWSE & COPY Data from SELECTED File in Excel
10:00
Leila Gharani
Рет қаралды 341 М.
Excel Formula to List All Sheet Tab Names and include Hyperlinks
11:28
MyOnlineTrainingHub
Рет қаралды 114 М.
List And Link All Sheets Excel VBA Macro
5:25
Excel Macro Mania
Рет қаралды 3,2 М.
Dynamic Array User Defined Function To Return All Sheet Names
4:05
How To Excel
Рет қаралды 3,7 М.
Excel VBA To Copy Data From One Sheet To Another (BEGINNER TO PRO!)
11:46
Tiger Spreadsheet Solutions
Рет қаралды 117 М.
EASILY Make an Automated Data Entry Form in Excel
14:52
Kenji Explains
Рет қаралды 1,1 МЛН
List All Your Sheets Efficiently in Excel (10 Levels)
29:48
Victor Chan
Рет қаралды 56 М.
Excel Macros & VBA - Tutorial for Beginners
50:20
Kevin Stratvert
Рет қаралды 1,3 МЛН
VBA Macro to Copy Data to Another Workbook
10:30
Excel Destination
Рет қаралды 73 М.