Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Excel VBA (part4): VBA File Dialog Box Saves File Name with Naming Conventions

Автор: Mike YU (BI&Analytics)

Загружено: 2021-12-15

Просмотров: 1854

Описание:

In the video I demonstrate the steps on how to create a VBA procedure to save file with naming conventions on it's name according to the inputs given by users.

In the file we have applied VBA FileDialog Object with it's SaveAs DialogType argument. The FileDialog properties AllowMultiSelect,FilterIndex,InitialFileName,InitialViewand methods Show and Execute are utilized in the procedure.


The relevant explainations links of the Object and Propertites are list here for your refrences:
FileDialog object (Office) | Microsoft Docs: https://docs.microsoft.com/en-us/offi...

FileDialog.AllowMultiSelect property (Office) | Microsoft Docs: https://docs.microsoft.com/en-us/offi...

FileDialog.FilterIndex property (Office) | Microsoft Docs:
https://docs.microsoft.com/en-us/offi...

FileDialog.InitialView property (Office) | Microsoft Docs:
https://docs.microsoft.com/en-us/offi...

FileDialog.Show method (Office) | Microsoft Docs:
https://docs.microsoft.com/en-us/offi...

FileDialog.Execute method (Office) | Microsoft Docs
https://docs.microsoft.com/en-us/offi...

FileDialog.SelectedItems property (Office) | Microsoft Docs:
https://docs.microsoft.com/en-us/offi...

You may copy VBA codelines here or find the VBA codes from my blog site:
https://mikeyu.lovestoblog.com/projects/

VBA Procedure:

Sub CmdSaveFile_Click()
Dim strFolder, Filename As String
'select the front pgae tab
Sheets("Front Page").Activate
'get the region name
Filename = ActiveSheet.Cells(10, 7)
'get the account name
Filename = Filename & "_" & ActiveSheet.Cells(11, 7)

'get the contact name
Filename = Filename & "_" & ActiveSheet.Cells(19, 7)
'get Sales rep name
Filename = Filename & "_" & ActiveSheet.Cells(20, 7)
'Add time stamp and file extenstion
Filename = Filename & "_" & Format(Now(), "yyyy-mm-dd_hh_mm") & ".xlsm"

'Open SaveAs dialog to a default with default file name
With Application.FileDialog(msoFileDialogSaveAs)
.AllowMultiSelect = False '
.FilterIndex = 2 '2 is xlsm
.InitialFileName = ActiveSheet.Cells(15, 7) & Filename
.InitialView = msoFileDialogViewDetails

If .Show = -1 Then strFolder = .SelectedItems(1) Else Exit Sub
.Execute
End With
End Sub


For more info of my BI & Analytics, please refer to the following website links:

My BI & Analytics Website:
https://sites.google.com/view/mikegua...

My blog website :
https://mikeyubianalytics.blogspot.com/

Excel VBA (part4): VBA File Dialog Box Saves File Name with Naming Conventions

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

array(10) { [0]=> object(stdClass)#5025 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "DmCsS5g5GCQ" ["related_video_title"]=> string(33) "Excel VBA Save File as Cell Value" ["posted_time"]=> string(21) "4 года назад" ["channelName"]=> string(14) "The Excel Cave" } [1]=> object(stdClass)#4998 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "JzX6Fnxm6Co" ["related_video_title"]=> string(94) "Excel VBA Macro Save .xlsm File to Specific Location as .xlsx | File Name Based on Cell Values" ["posted_time"]=> string(21) "3 года назад" ["channelName"]=> string(15) "Chester Tugwell" } [2]=> object(stdClass)#5023 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "f0UMMKCzVrI" ["related_video_title"]=> string(74) "Excel VBA Macro: Save As Dialog (Allow User to Select Saved File Location)" ["posted_time"]=> string(21) "3 года назад" ["channelName"]=> string(13) "greggowaffles" } [3]=> object(stdClass)#5030 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "6LAIa_agvLg" ["related_video_title"]=> string(103) "Power Platform Automations: Auto Upload & Refresh Cloud PBI Reports Triggered by Email Attached ZIP" ["posted_time"]=> string(27) "6 месяцев назад" ["channelName"]=> string(22) "Mike YU (BI&Analytics)" } [4]=> object(stdClass)#5009 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "5YPdC1lA3HA" ["related_video_title"]=> string(106) "Power Platform Integrations: Embed Power Apps into Power BI with Power Automate & Excel & OneDrive" ["posted_time"]=> string(27) "7 месяцев назад" ["channelName"]=> string(22) "Mike YU (BI&Analytics)" } [5]=> object(stdClass)#5027 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "IcLWETIf3J4" ["related_video_title"]=> string(116) "Жириновский о евреях! Что будет, когда Израиль проиграет? 2004 год" ["posted_time"]=> string(19) "1 год назад" ["channelName"]=> string(13) "ЛДПР-ТВ" } [6]=> object(stdClass)#5022 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "vQoosZBiFKo" ["related_video_title"]=> string(152) "🔴Точка СРЫВА скоро... Киев ПОДЕЛЯТ по Днепру? Арестович. Зеленскому больше не верят" ["posted_time"]=> string(24) "12 часов назад" ["channelName"]=> string(28) "ШЕЛЕСТ. Акценты" } [7]=> object(stdClass)#5032 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "QWx6QBlpvns" ["related_video_title"]=> string(88) "1. Встреча на Патриарших. Мастер и Маргарита. Full HD" ["posted_time"]=> string(19) "1 год назад" ["channelName"]=> string(19) "NightHORROR_Channel" } [8]=> object(stdClass)#5008 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "h_sC6Uwtwxk" ["related_video_title"]=> string(57) "VBA to BROWSE & COPY Data from SELECTED File in Excel" ["posted_time"]=> string(19) "5 лет назад" ["channelName"]=> string(13) "Leila Gharani" } [9]=> object(stdClass)#5026 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "0teeDnPNito" ["related_video_title"]=> string(152) "ТАК МЫСЛЯТ ПСИХОПАТЫ! КАК ПОНЯТЬ ЧТО РЯДОМ С ТОБОЙ ПСИХОПАТ? ОТНОШЕНИЯ С ПСИХОПАТОМ" ["posted_time"]=> string(25) "2 недели назад" ["channelName"]=> string(7) "cogitos" } }
Excel VBA Save File as Cell Value

Excel VBA Save File as Cell Value

Excel VBA Macro Save .xlsm File to Specific Location as .xlsx | File Name Based on Cell Values

Excel VBA Macro Save .xlsm File to Specific Location as .xlsx | File Name Based on Cell Values

Excel VBA Macro: Save As Dialog (Allow User to Select Saved File Location)

Excel VBA Macro: Save As Dialog (Allow User to Select Saved File Location)

Power Platform Automations: Auto Upload & Refresh Cloud PBI Reports Triggered by Email Attached ZIP

Power Platform Automations: Auto Upload & Refresh Cloud PBI Reports Triggered by Email Attached ZIP

Power Platform Integrations: Embed Power Apps into Power BI with Power Automate & Excel & OneDrive

Power Platform Integrations: Embed Power Apps into Power BI with Power Automate & Excel & OneDrive

Жириновский о евреях! Что будет, когда Израиль проиграет? 2004 год

Жириновский о евреях! Что будет, когда Израиль проиграет? 2004 год

🔴Точка СРЫВА скоро... Киев ПОДЕЛЯТ по Днепру? Арестович. Зеленскому больше не верят

🔴Точка СРЫВА скоро... Киев ПОДЕЛЯТ по Днепру? Арестович. Зеленскому больше не верят

1. Встреча на Патриарших. Мастер и Маргарита. Full HD

1. Встреча на Патриарших. Мастер и Маргарита. Full HD

VBA to BROWSE & COPY Data from SELECTED File in Excel

VBA to BROWSE & COPY Data from SELECTED File in Excel

ТАК МЫСЛЯТ ПСИХОПАТЫ! КАК ПОНЯТЬ ЧТО РЯДОМ С ТОБОЙ ПСИХОПАТ? ОТНОШЕНИЯ С ПСИХОПАТОМ

ТАК МЫСЛЯТ ПСИХОПАТЫ! КАК ПОНЯТЬ ЧТО РЯДОМ С ТОБОЙ ПСИХОПАТ? ОТНОШЕНИЯ С ПСИХОПАТОМ

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]