Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default how do I write a request to 'Save As' Macro

Hi, I have recorded a macro which opens a new workbook called 'wizdatasave',
then the macro selects and copies 2 worsheets from another open workbook and
pastes them into the newly open workbook 'wizdatasave'. What code do I enter
into the macro to automate the 'Save As' function? I need to save the
'wizdatasave' workbook as something different each time it is opened.

regards

Craig
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default how do I write a request to 'Save As' Macro

Maybe you could use the date/time appended to the name:

Dim WizWkbk as workbook
set wizwkbk = workbooks.open("C:\somefolder\wizdatasave.xls")
'do the work

wizwkbk.saveas filename:="C:\someexistingfolder\wizdata" _
& format(now, "yyyymmdd-hhmmss") & ".xls", _
fileformat:=xlworkbooknormal



CRAIG K wrote:

Hi, I have recorded a macro which opens a new workbook called 'wizdatasave',
then the macro selects and copies 2 worsheets from another open workbook and
pastes them into the newly open workbook 'wizdatasave'. What code do I enter
into the macro to automate the 'Save As' function? I need to save the
'wizdatasave' workbook as something different each time it is opened.

regards

Craig


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default how do I write a request to 'Save As' Macro

Hi Dave, I actually need to call teh work book by a different number which
may not be incremental so I would have to enter it manually at the save as
stage such as "2350wiz.xls". Here is the actual macro to show you what I have
and maybe you could show me how to append the 'save as' bit to the end

regards


Craig

Workbooks.Open Filename:="C:\excel run data\data\WIZSAVEDATA.xls"
Windows("JETLOOPR.XLS").Activate
Sheets("Ten Minutes").Select
Sheets("Ten Minutes").Copy Befo=Workbooks("WIZSAVEDATA.xls").Sheets(1)
Windows("JETLOOPR.XLS").Activate
Sheets("Hourly").Select
Sheets("Hourly").Copy Befo=Workbooks("WIZSAVEDATA.xls").Sheets(1)
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

End Sub

"Dave Peterson" wrote:

Maybe you could use the date/time appended to the name:

Dim WizWkbk as workbook
set wizwkbk = workbooks.open("C:\somefolder\wizdatasave.xls")
'do the work

wizwkbk.saveas filename:="C:\someexistingfolder\wizdata" _
& format(now, "yyyymmdd-hhmmss") & ".xls", _
fileformat:=xlworkbooknormal



CRAIG K wrote:

Hi, I have recorded a macro which opens a new workbook called 'wizdatasave',
then the macro selects and copies 2 worsheets from another open workbook and
pastes them into the newly open workbook 'wizdatasave'. What code do I enter
into the macro to automate the 'Save As' function? I need to save the
'wizdatasave' workbook as something different each time it is opened.

regards

Craig


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default how do I write a request to 'Save As' Macro

Const FILE_BASE As String = "C:\excel run data\data\WIZSAVEDATA"

Set wb = Workbooks.Open(Filename:=FILE_BASE & ".xls")
Windows("JETLOOPR.XLS").Activate
Sheets("Ten Minutes").Select
Sheets("Ten Minutes").Copy
Befo=Workbooks("WIZSAVEDATA.xls").Sheets(1)
Windows("JETLOOPR.XLS").Activate
Sheets("Hourly").Select
Sheets("Hourly").Copy Befo=Workbooks("WIZSAVEDATA.xls").Sheets(1)
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ans = InputBox("Supply filename increment")
wb.SaveAs FILE_BASE & ans & ".xls"


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"CRAIG K" wrote in message
...
Hi Dave, I actually need to call teh work book by a different number which
may not be incremental so I would have to enter it manually at the save as
stage such as "2350wiz.xls". Here is the actual macro to show you what I
have
and maybe you could show me how to append the 'save as' bit to the end

regards


Craig

Workbooks.Open Filename:="C:\excel run data\data\WIZSAVEDATA.xls"
Windows("JETLOOPR.XLS").Activate
Sheets("Ten Minutes").Select
Sheets("Ten Minutes").Copy
Befo=Workbooks("WIZSAVEDATA.xls").Sheets(1)
Windows("JETLOOPR.XLS").Activate
Sheets("Hourly").Select
Sheets("Hourly").Copy Befo=Workbooks("WIZSAVEDATA.xls").Sheets(1)
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

End Sub

"Dave Peterson" wrote:

Maybe you could use the date/time appended to the name:

Dim WizWkbk as workbook
set wizwkbk = workbooks.open("C:\somefolder\wizdatasave.xls")
'do the work

wizwkbk.saveas filename:="C:\someexistingfolder\wizdata" _
& format(now, "yyyymmdd-hhmmss") & ".xls", _
fileformat:=xlworkbooknormal



CRAIG K wrote:

Hi, I have recorded a macro which opens a new workbook called
'wizdatasave',
then the macro selects and copies 2 worsheets from another open
workbook and
pastes them into the newly open workbook 'wizdatasave'. What code do I
enter
into the macro to automate the 'Save As' function? I need to save the
'wizdatasave' workbook as something different each time it is opened.

regards

Craig


--

Dave Peterson



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default how do I write a request to 'Save As' Macro

If you want to type in the name of the file, then why not just hit ctrl-s or
File|SaveAs.

But you could show that same dialog with a line:
Application.Dialogs(xlDialogSaveAs).Show



CRAIG K wrote:

Hi Dave, I actually need to call teh work book by a different number which
may not be incremental so I would have to enter it manually at the save as
stage such as "2350wiz.xls". Here is the actual macro to show you what I have
and maybe you could show me how to append the 'save as' bit to the end

regards

Craig

Workbooks.Open Filename:="C:\excel run data\data\WIZSAVEDATA.xls"
Windows("JETLOOPR.XLS").Activate
Sheets("Ten Minutes").Select
Sheets("Ten Minutes").Copy Befo=Workbooks("WIZSAVEDATA.xls").Sheets(1)
Windows("JETLOOPR.XLS").Activate
Sheets("Hourly").Select
Sheets("Hourly").Copy Befo=Workbooks("WIZSAVEDATA.xls").Sheets(1)
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

End Sub

"Dave Peterson" wrote:

Maybe you could use the date/time appended to the name:

Dim WizWkbk as workbook
set wizwkbk = workbooks.open("C:\somefolder\wizdatasave.xls")
'do the work

wizwkbk.saveas filename:="C:\someexistingfolder\wizdata" _
& format(now, "yyyymmdd-hhmmss") & ".xls", _
fileformat:=xlworkbooknormal



CRAIG K wrote:

Hi, I have recorded a macro which opens a new workbook called 'wizdatasave',
then the macro selects and copies 2 worsheets from another open workbook and
pastes them into the newly open workbook 'wizdatasave'. What code do I enter
into the macro to automate the 'Save As' function? I need to save the
'wizdatasave' workbook as something different each time it is opened.

regards

Craig


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default how do I write a request to 'Save As' Macro

thanks, problem sorted

regards

Craig

"Dave Peterson" wrote:

If you want to type in the name of the file, then why not just hit ctrl-s or
File|SaveAs.

But you could show that same dialog with a line:
Application.Dialogs(xlDialogSaveAs).Show



CRAIG K wrote:

Hi Dave, I actually need to call teh work book by a different number which
may not be incremental so I would have to enter it manually at the save as
stage such as "2350wiz.xls". Here is the actual macro to show you what I have
and maybe you could show me how to append the 'save as' bit to the end

regards

Craig

Workbooks.Open Filename:="C:\excel run data\data\WIZSAVEDATA.xls"
Windows("JETLOOPR.XLS").Activate
Sheets("Ten Minutes").Select
Sheets("Ten Minutes").Copy Befo=Workbooks("WIZSAVEDATA.xls").Sheets(1)
Windows("JETLOOPR.XLS").Activate
Sheets("Hourly").Select
Sheets("Hourly").Copy Befo=Workbooks("WIZSAVEDATA.xls").Sheets(1)
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

End Sub

"Dave Peterson" wrote:

Maybe you could use the date/time appended to the name:

Dim WizWkbk as workbook
set wizwkbk = workbooks.open("C:\somefolder\wizdatasave.xls")
'do the work

wizwkbk.saveas filename:="C:\someexistingfolder\wizdata" _
& format(now, "yyyymmdd-hhmmss") & ".xls", _
fileformat:=xlworkbooknormal



CRAIG K wrote:

Hi, I have recorded a macro which opens a new workbook called 'wizdatasave',
then the macro selects and copies 2 worsheets from another open workbook and
pastes them into the newly open workbook 'wizdatasave'. What code do I enter
into the macro to automate the 'Save As' function? I need to save the
'wizdatasave' workbook as something different each time it is opened.

regards

Craig

--

Dave Peterson


--

Dave Peterson

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
Macro Request: Fill in empty cells with previous Filled cell in column Artis Excel Worksheet Functions 2 June 25th 07 08:30 PM
no need save request box when excel is closing. Narendra Boga[_2_] Excel Discussion (Misc queries) 1 May 31st 07 06:58 PM
Can I write an excel formula to display the file save date? Bob-123456789 Excel Worksheet Functions 1 January 26th 06 07:50 PM
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? Daniel Excel Worksheet Functions 1 June 23rd 05 11:38 PM
How to Create an Excel Macro to send a meeting request. DM HD Excel Discussion (Misc queries) 2 February 28th 05 02:39 PM


All times are GMT +1. The time now is 11:24 PM.

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

About Us

"It's about Microsoft Excel"