View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default names in file name

If they're named ranges (single cell ranges, too!), I'd use something like:

Dim ThisFile as string
thisfile = worksheets("sheet1").range("borrowerName").value _
& worksheets("Sheet2").range("loannumber").value _
& format(worksheets("Sheet3").range("reviewdate").va lue, "yyyy-mm-dd") _
& ".xls"

If one of them were a named constant(?), I'd use something like this to get it:

MsgBox Application.Evaluate(ActiveWorkbook.Names("Borrowe rName").RefersTo)



Slim Slender wrote:

Can I create a file name from Names or Named Ranges in a workbook?
If there are Names BorrowerName, LoanNumber, ReviewDate, in the WB,
can I do this:
ThisFile = BorrowerName & LoanNumber & ReviewDate & ".xls"
Application.Dialogs(xlDialogSaveAs).Show (ThisFile)
or something like that?


--

Dave Peterson