filmov
tv
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). In this video, we go over how to create a macro that allows a user to select a location to save a particular file. We write code that, when run, will prompt the user to select a save file name and location for a workbook (created from copying the activesheet), and then the save is executed.
Code (YouTube doesn't allow brackets; so LT and GT are used for less than and greater than, respectively):
Sub allow_user_to_select_save_location()
Dim region As String
Dim selection As Variant
region = ActiveSheet.Cells(2, 2).Text
ActiveSheet.Copy
selection = Application.GetSaveAsFilename( _
FileFilter:="Excel Workbook (*.xlsx), *.xlsx", _
Title:="Please Select Location to Save File", _
InitialFileName:="Region Report " & region & " " & _
Format(Date, "mm-dd-yy"))
If selection LTGT False Then
ActiveWorkbook.SaveAs Filename:=selection
End If
ActiveWorkbook.Close savechanges:=False
End Sub
Data used in this video:
#ExcelVBA #ExcelMacro
Code (YouTube doesn't allow brackets; so LT and GT are used for less than and greater than, respectively):
Sub allow_user_to_select_save_location()
Dim region As String
Dim selection As Variant
region = ActiveSheet.Cells(2, 2).Text
ActiveSheet.Copy
selection = Application.GetSaveAsFilename( _
FileFilter:="Excel Workbook (*.xlsx), *.xlsx", _
Title:="Please Select Location to Save File", _
InitialFileName:="Region Report " & region & " " & _
Format(Date, "mm-dd-yy"))
If selection LTGT False Then
ActiveWorkbook.SaveAs Filename:=selection
End If
ActiveWorkbook.Close savechanges:=False
End Sub
Data used in this video:
#ExcelVBA #ExcelMacro
Excel VBA Macro Save .xlsm File to Specific Location as .xlsx | File Name Based on Cell Values
Excel VBA - Save a Macro Workbook
Excel VBA Macro: Save File As Based on Cell Value (Step-by-Step Tutorial)
VBA/Macro Course - 3 Ways to Create New Workbooks & Save and Close Them Using a Macro
VBA Save As File to Specific Location - Workbook Save as VBA Code Examples
Excel VBA Macro: Save File As Previous Day (to Specific Folder)
Excel VBA Macro: Save As Dialog (Allow User to Select Saved File Location)
Save As Dialog to Save a Workbook in Excel VBA
STOP Missing Deadlines! Create a Popup Reminder in Excel!
Excel Save Copy of Workbook | VBA Macro #20
Conquering SaveAs in VBA - Saving in Multiple File Formats - CODE and Download Included
Excel VBA to Save Data to Another Workbook
Excel VBA to Export Range as Image - VBA Coding to Export Image
Excel VBA - Save & Close Workbook
Excel VBA Macro: Autofilter, Copy, Paste to New Sheet and Save to Specified Folder (Dynamic Range)
Excel VBA Macro: Save File As with Password Protection (Step-by-Step Tutorial)
VBA to Save Each Worksheet as New Workbook - VBA Save as new excel file
Excel VBA Macro: Save File As Previous Work/Business Day (Excluding Holidays)
Excel VBA - Convert To PDF with a Custom Name Based on Cell Value & Saved to Specific Folder
Excel VBA Macro: Save File As Copy with Password Protection (Step-by-Step Tutorial)
Excel - How to Save an Excel File as a Copy: VBA SaveAsCopy - Episode 2213
VBA SaveAs to Overwrite Existing File without Prompt - Excel Quickie 48
How to Create a Button in Microsoft Excel VBA (Save As, Save, Close)
Excel VBA - Run Macro BEFORE Save
Комментарии