Michael Downey
Michael Downey

Reputation: 687

Excel Macro to Save information

Ok so I am creating a Macro in Excel 2010. I am looking to project data in to the future. What I want to do is create a button in Excel "What if" that will allow me to freely edit the data. Then after I am done I would like to have another button "Reset" which if I pushed would reset the entire data set to what was previously there. Then if it were possible create another button. "Last Scenario" which would return the last "What if change."

For example use a excel with months Jan-Dec Then with

  1. Sales
  2. Costs
  3. Profits (Sales - Costs = Profits)

I would hopefully like to do this only having one excel sheet and doing all this without having to save outside of excel. If there was a way to save in a new sheet temporarly to recall from. Then it saves the Last Scenario until a new whatif is created which erases the old whatif.

Thanks

Upvotes: 1

Views: 288

Answers (1)

theGame
theGame

Reputation: 393

to save the current Excel file with a filename derived from cell A1

Public Sub SaveAsA1()
    ThisFile = Range("A1").Value
    ActiveWorkbook.SaveAs Filename:=ThisFile
End Sub

Upvotes: 1

Related Questions