Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Match file names listed in column with file names in folder | Excel Programming | |||
Open Excel file get error with file names that have spaces in the | Setting up and Configuration of Excel | |||
vba to get file extension from col A file names | Excel Programming | |||
Open external data (varying file names) and closing file once data is retrieved | Excel Programming | |||
EXCEL97 FILE NAMES TRUNCATED TO THE FIRST LETTER IN THE FILE NAME | New Users to Excel |