\ / * ? | : ; """, , szDefaultName ' If a name has been specified: If szNewBookName <> Empty Then ' Suppress messages .">
Most valuable professional
  • Hot Topics

Excel Have File saved from name found in specific cell

I found this code on another site and it works fine as it is. What is needed to have it look at in worksheet Inventory in cell B42 rather than having to enter the name? Code: Option Explicit Sub KillPreviousFile() Dim szMsgResponse As String ' Get the name of this workbook with Dim szDefaultName As String szDefaultName = Left(ThisWorkbook.Name, StartAgain: ' Use an input box to obtain the new Dim szNewBookName As String szNewBookName = InputBox("Please enter vbNewLine & _ "It will be saved in the same directory vbNewLine & _ "Valid file-names cannot include these "< > \ / * ? | : ; """, , szDefaultName ' If a name has been specified: If szNewBookName <> Empty Then ' Suppress messages

This question generated 13 answers. To proceed to the answers, click here.

This thread is current as of August 1, 2017.

For more resources for Microsoft Excel:

This article includes the following tags:

  • Excel
  • Microsoft Excel