S
sowetoddid
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").PasteSpecial _
xlPasteValuesAndNumberFormats
OpenedWB.Close False
End If
End Sub
Thank you
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").PasteSpecial _
xlPasteValuesAndNumberFormats
OpenedWB.Close False
End If
End Sub
Thank you