ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Assigning Name to new workbook (https://www.excelbanter.com/excel-worksheet-functions/105218-assigning-name-new-workbook.html)

dan

Assigning Name to new workbook
 
Want to assign a name to a worksheet based on user input.

DataFileName = Application.GetOpenFilename(filefilter:="Text or ASC Files,
*.txt; *.asc", Title:="Select the Data File")

'Create A New WorkBook With One Worksheet
Workbooks.Add template:=xlWorksheet

Want the workbook name to be the same name as that opened by DataFileName
and not "Sheet1".

Thanks

Bob Phillips

Assigning Name to new workbook
 
Then you need to save it with that filename, the filename only gets assigned
on a save.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dan" wrote in message
...
Want to assign a name to a worksheet based on user input.

DataFileName = Application.GetOpenFilename(filefilter:="Text or ASC

Files,
*.txt; *.asc", Title:="Select the Data File")

'Create A New WorkBook With One Worksheet
Workbooks.Add template:=xlWorksheet

Want the workbook name to be the same name as that opened by DataFileName
and not "Sheet1".

Thanks




dan

Assigning Name to new workbook
 
Is there a way to prefill in the "File Name:" in the Save As window?


"Bob Phillips" wrote:

Then you need to save it with that filename, the filename only gets assigned
on a save.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dan" wrote in message
...
Want to assign a name to a worksheet based on user input.

DataFileName = Application.GetOpenFilename(filefilter:="Text or ASC

Files,
*.txt; *.asc", Title:="Select the Data File")

'Create A New WorkBook With One Worksheet
Workbooks.Add template:=xlWorksheet

Want the workbook name to be the same name as that opened by DataFileName
and not "Sheet1".

Thanks





Bob Phillips

Assigning Name to new workbook
 
Why would you use the SaveAs window? you have the filename so just save it
with that name.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dan" wrote in message
...
Is there a way to prefill in the "File Name:" in the Save As window?


"Bob Phillips" wrote:

Then you need to save it with that filename, the filename only gets

assigned
on a save.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dan" wrote in message
...
Want to assign a name to a worksheet based on user input.

DataFileName = Application.GetOpenFilename(filefilter:="Text or ASC

Files,
*.txt; *.asc", Title:="Select the Data File")

'Create A New WorkBook With One Worksheet
Workbooks.Add template:=xlWorksheet

Want the workbook name to be the same name as that opened by

DataFileName
and not "Sheet1".

Thanks








All times are GMT +1. The time now is 09:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com