jackson1990
Board Regular
- Joined
- Feb 21, 2017
- Messages
- 56
Hey everyone!
Was wondering if someone could help me out with a mystery. I have a macro that asks the user to save their Excel. I was looking if I could default the Save As Text to be the text from say H16 on the Active Sheet. So instead of taking the default name of the workbook they have currently (say Workbook1), it would default to whatever the text is in H16. I have some code now, but couldn't quite connect how I would get it to default as that. Here's the code.
Thanks everyone for taking a look!
Was wondering if someone could help me out with a mystery. I have a macro that asks the user to save their Excel. I was looking if I could default the Save As Text to be the text from say H16 on the Active Sheet. So instead of taking the default name of the workbook they have currently (say Workbook1), it would default to whatever the text is in H16. I have some code now, but couldn't quite connect how I would get it to default as that. Here's the code.
Code:
Sub Update()
Application.ScreenUpdating = False
Dim wsheet As Worksheet
Sheets("Sheet1").Select
ActiveWorkbook.RefreshAll
DoEvents
If Worksheets("Sheet1").Range("D14") = Worksheets("Sheet1").Range("F14") Then
MsgBox "Update Complete", vbInformation + vbOKOnly
MsgBox "Please save the file in the location you will keep it permanently. If you do not, certain features will not work.", vbExclamation + vbOKOnly
wsn = Application.GetSaveAsFilename(FileFilter:= _
"Excel Files (*.xlsm), *.xlsm")
If wsn <> False Then
ActiveWorkbook.SaveAs _
Filename:="test", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled
ActiveSheet.CommandButton1.Enabled = True
End If
End Sub
Thanks everyone for taking a look!