![]() |
names in file name
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? |
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 |
names in file name
On Apr 28, 8:28*pm, Dave Peterson 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").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) 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. |
names in file name
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 |
All times are GMT +1. The time now is 02:22 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com