LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saveas with name of another file

This is the code I am using to open another excel file, copy data an
paste it into the original file. Is it possible to add a line in thi
macro that will do a saveas on the original workbook (ThisWB)? I woul
like to do a saveas with the name of the other file (OpenedWB) and "-F
for Finished.

So, ThisWB would have a saveas with the name being "OpenedWB - F".

Sub testIt()
Dim ThisWB As Workbook, OpenedWB As Workbook, _
OpenFileName As Variant
Set ThisWB = ThisWorkbook
OpenFileName = Application.GetOpenFilename()
If LCase(TypeName(OpenFileName)) = "boolean" Then
Else
Set OpenedWB = Workbooks.Open(OpenFileName)
OpenedWB.Sheets(1).Range("A1:Z100").Copy
ThisWB.Worksheets("sheet1").Range("b1").PasteSpeci al _
xlPasteValuesAndNumberFormats
OpenedWB.Close False
End If
End Sub


Thank you

--
Message posted from http://www.ExcelForum.com

 
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
Can you Pre-fill file name in SaveAs dialog Jive Excel Worksheet Functions 1 November 12th 07 04:30 PM
Confused here Prevent Saving File - but allow ONLY File SAVEAS Met JMay Excel Discussion (Misc queries) 2 June 17th 07 04:37 PM
saveas CSV file stevekirk Excel Discussion (Misc queries) 0 August 10th 06 01:11 PM
SaveAs another file name, then keep working L Mehl Excel Programming 2 February 24th 04 02:11 AM
VBA capture File SaveAs Event Linda Mcfarlane Excel Programming 2 September 17th 03 04:06 AM


All times are GMT +1. The time now is 10:09 PM.

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"