ycliper

Популярное

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

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

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

Топ запросов

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

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

Excel VBA

FileDialog Object

FileDialog Properties

FileDialog.AllowMultiSelect property

FileDialog.FilterIndex property

FileDialog.InitialView property

FileDialog.Show method

FileDialog.Execute method

FileDialog.SelectedItems property

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

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

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

Описание: 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/

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Excel VBA (part4): VBA File Dialog Box Saves File Name with Naming Conventions

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

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

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

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

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

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

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



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



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