Cell To Be Filename

  • Thread starter Thread starter Dan_Crew
  • Start date Start date
D

Dan_Crew

Anyway that say that the contents of cell B5
When saved become the filenam
 
Sample: In J2 Sheet1 >>> "Testaroonie" (without quotes)
In a standard module put:

Sub testme()
Application.Dialogs(xlDialogSaveAs).Show _
Worksheets("sheet1").Range("j2").Value & ".xls"
End Sub

HTH
 
ActiveWorkbook.SaveAs Filename:=Range("B5") & ".xls"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Dan_Crew said:
Anyway that say that the contents of cell B5
When saved become the filename

In any cell you choose:
=+cell("filename")
path for that file will show and be save when you save.
 
You've answered another question , and the + is unnecessary, and you should
anchor the function to the sheet with a cell reference

=CELL("filename",A1)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Willis

try


FileName = "DayReport" & day(now()) & ".xls"

ActiveWorkbook.SaveAs "c:\termp\" & FileNam
 

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

Back
Top