From: Slim Slender on
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?
From: Dave Peterson on
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").value, "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("BorrowerName").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
From: Slim Slender on
On Apr 28, 8:28 pm, Dave Peterson <peter...(a)verizonXSPAM.net> wrote:
> 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").value, "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("BorrowerName").RefersTo)
>
> SlimSlenderwrote:
>
> > 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

Dave,
Thanks again (you've helped me with several problems). Elegant syntax,
you even got the grammer right using the subjunctive where needed.
From: Dave Peterson on
Watch your spelling <vbg>.

When I have typos, I blame my fingers -- not my brain.



Slim Slender wrote:
>
<<snipped>>
>
> Dave,
> Thanks again (you've helped me with several problems). Elegant syntax,
> you even got the grammer right using the subjunctive where needed.

--

Dave Peterson