From: Slim Slender on 28 Apr 2010 18:27 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 28 Apr 2010 20:28 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 30 Apr 2010 06:31 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 30 Apr 2010 08:53 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
|
Pages: 1 Prev: Who is in a network shared Excel file Next: Sort Worksheets Numerically |