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
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" <Dan@discussions.microsoft.com> wrote in message
news:88860778-9FFF-4262-B214-A2005617254A@microsoft.com...
> 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
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" <Dan@discussions.microsoft.com> wrote in message
> news:88860778-9FFF-4262-B214-A2005617254A@microsoft.com...
> > 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
>
>
>
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" <Dan@discussions.microsoft.com> wrote in message
news:9DB89E0C-B469-4D3B-96D3-58B5455DE2C4@microsoft.com...
> 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" <Dan@discussions.microsoft.com> wrote in message
> > news:88860778-9FFF-4262-B214-A2005617254A@microsoft.com...
> > > 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
> >
> >
> >
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks