Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
dan dan is offline
external usenet poster
 
Posts: 866
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
dan dan is offline
external usenet poster
 
Posts: 866
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default 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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel exits unexpectedly or hangs the second time I open workbook r_m_i Excel Discussion (Misc queries) 0 February 9th 06 10:14 PM
Repost:Automatically inserting a row in external workbook 50pingviner Excel Discussion (Misc queries) 3 December 28th 05 07:38 PM
keeping a toolbar attached to a workbook Paul Ponzelli Excel Discussion (Misc queries) 0 August 12th 05 11:39 PM
Find a value in a workbook and return the worksheet name Craig Excel Discussion (Misc queries) 2 August 10th 05 09:47 PM
How to hyperlink from a workbook to sheets in another workbook? MJOHNSON Excel Worksheet Functions 0 February 17th 05 08:31 PM


All times are GMT +1. The time now is 10:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"