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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am not sure if I described this sufficiently...
Using sample names, Workbook1 = Music Workbook2 = Animal Using a macro in "Music", I would like to access the file name in "Animal" and do a saveas on the Music File. The result is three files... "Music" "Animal" "Animal - F" Hope that helps --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am finding this somewhat difficult to explain. Ok, one more time.
Starting with the "Music" file I run the macro The macro accesses "Animal" file, copies some of the data and pastes i to the "Music" File Next, I would like the updated "Music" File to be saved as "Animal - F (or what ever the name of the accessed file, adding "- F" to the end) Any ideas -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is this right??
ActiveWorkbook.SaveAs FileName:="OpenedWB - F" Also, how would I designate a specific directory for the save? Thanks -- Message posted from http://www.ExcelForum.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
use ChDir prior to saving the file -- Regards Frank Kabel Frankfurt, Germany Is this right?? ActiveWorkbook.SaveAs FileName:="OpenedWB - F" Also, how would I designate a specific directory for the save? Thanks. --- Message posted from http://www.ExcelForum.com/ |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A little uniformed on this,....can you be more specific on how to d
this. I am a Senior Forum member only because I ask sooo many questions!! just became interested in the VB code and found a lot of applications. The problem is I only have enough programming skill to be dangerous. Thanks -- Message posted from http://www.ExcelForum.com |
Reply |
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 |