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

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
 
T

Tom Ogilvy

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top