Загрузка страницы

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

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

Видео Excel VBA Macro: List All Sheet/Tab Names (From Another User Selected Workbook) канала greggowaffles
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
5 октября 2021 г. 4:56:13
00:09:10
Другие видео канала
Excel VBA Macro: Open Newest Files (from Multiple Folders) and Save Them in Another FolderExcel VBA Macro: Open Newest Files (from Multiple Folders) and Save Them in Another FolderComment Out Blocks of Code 🤓 #excelmacro #excelvba #msexcelComment Out Blocks of Code 🤓 #excelmacro #excelvba #msexcelExcel VBA Macro: Delete All Sheets that Contain a Certain Text (String) ValueExcel VBA Macro: Delete All Sheets that Contain a Certain Text (String) ValueExcel VBA Macro: Resize Range (Table) Pasted As Image In Email BodyExcel VBA Macro: Resize Range (Table) Pasted As Image In Email BodyExcel VBA Macro: Count and List the Number of (Conditonally Formatted) Cells at the End of Each RowExcel VBA Macro: Count and List the Number of (Conditonally Formatted) Cells at the End of Each RowExcel VBA Macro: Save File As Previous Work/Business Day (Excluding Holidays)Excel VBA Macro: Save File As Previous Work/Business Day (Excluding Holidays)Excel VBA Macro: Send Email with Hyperlink (that has Spaces in the File Name)Excel VBA Macro: Send Email with Hyperlink (that has Spaces in the File Name)Excel VBA Macro: Right Align Image in Email Body (and Resize)Excel VBA Macro: Right Align Image in Email Body (and Resize)Excel VBA Macro: List Time Last Saved (For All Files In Folder)Excel VBA Macro: List Time Last Saved (For All Files In Folder)Excel VBA Macro: Delete Rows If Any Cell in Those Rows (Across All Columns) Contains a Certain ValueExcel VBA Macro: Delete Rows If Any Cell in Those Rows (Across All Columns) Contains a Certain ValueExcel VBA Macro: Autofilter And Copy/Paste To Multiple Sheets (Dynamic Range)Excel VBA Macro: Autofilter And Copy/Paste To Multiple Sheets (Dynamic Range)Excel VBA Macro: Resize Large Table Ranges After Pasting (As Image) In Email BodyExcel VBA Macro: Resize Large Table Ranges After Pasting (As Image) In Email BodyExcel VBA Macro: Export Selected Range as Image (Save Range as Picture)Excel VBA Macro: Export Selected Range as Image (Save Range as Picture)Excel VBA Macro: Send Email with Attachments from a List (Dynamic Range)Excel VBA Macro: Send Email with Attachments from a List (Dynamic Range)Excel VBA Macro: Remove Special Characters (in List of Strings) & Post New Strings Next to Old OnesExcel VBA Macro: Remove Special Characters (in List of Strings) & Post New Strings Next to Old OnesExcel VBA Macro: Capitalize First Letter of Every Word in a (Static/Dynamic) Range of StringsExcel VBA Macro: Capitalize First Letter of Every Word in a (Static/Dynamic) Range of StringsExcel VBA Macro: Find Sheet in Another (User Selected) Workbook and Copy Data OverExcel VBA Macro: Find Sheet in Another (User Selected) Workbook and Copy Data OverExcel VBA Macro: Create Word Document & Add Table (Static Range)Excel VBA Macro: Create Word Document & Add Table (Static Range)Excel VBA Macro: Add New Sheets To Beginning Or End of Workbook (With Names)Excel VBA Macro: Add New Sheets To Beginning Or End of Workbook (With Names)Excel VBA Macro: Save Selected Range as PDF (and Center on Page)Excel VBA Macro: Save Selected Range as PDF (and Center on Page)
Яндекс.Метрика