Using the output of a formula to name a workbook or sheet

  • Thread starter Thread starter Jgrodz
  • Start date Start date
J

Jgrodz

I have a template which I use each week to produce a new workbook.

I name the weekly workbook with a week number generated by a formula
dependent on the date of the calculation.

How can I "capture" the output of the formula and use it within a Macro
to name the workbook each week?

Jonathan Grodzinski
 
Public Sub SetWorkbookName()
ThisWorkbook.SaveAs Filename:="C:\myfolder\" & format( _
Worksheets(1).Range("A1").Value,"00") & ".xls", _
fileformat:=xlWorkbookNormal
End Sub
 
Back
Top