ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using the output of a formula to name a workbook or sheet (https://www.excelbanter.com/excel-programming/276980-using-output-formula-name-workbook-sheet.html)

Jgrodz

Using the output of a formula to name a workbook or sheet
 
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Tom Ogilvy

Using the output of a formula to name a workbook or sheet
 
Public Sub SetWorkbookName()
ThisWorkbook.SaveAs Filename:="C:\myfolder\" & format( _
Worksheets(1).Range("A1").Value,"00") & ".xls", _
fileformat:=xlWorkbookNormal
End Sub

--
Regards,
Tom Ogilvy


Jgrodz wrote in message
...
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





All times are GMT +1. The time now is 10:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com