Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can you Pre-fill file name in SaveAs dialog | Excel Worksheet Functions | |||
Confused here Prevent Saving File - but allow ONLY File SAVEAS Met | Excel Discussion (Misc queries) | |||
saveas CSV file | Excel Discussion (Misc queries) | |||
SaveAs another file name, then keep working | Excel Programming | |||
VBA capture File SaveAs Event | Excel Programming |