To copy and past both workbook have to be open
May be you would like some macro to open the second workbook from the same directory where the 1st workbook was opened?
Like dir = get the directory for current workbook
Open workbook dir & "\secondfile.xls"
Copy
Paste
Is this is what you need?
yes I guessed you needed a macro now
Shall the macro ask for a directory in a pop up?
Or shall the macro read the directory of the first, that is open, file and open the second?
There is a couple of ways to do what you said
If both file are already open you need not to use a directory name
Sub copyopenpasteclose()
Dim d As String
d = Application.ActiveWorkbook.Path
Range("C4:D5").Copy
Workbooks.Open Filename:=d & "\secondfile.xlsx"
Range("F13").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub
Here some vba code to do what I understand you want
Code:Sub copyopenpasteclose() Dim d As String d = Application.ActiveWorkbook.Path Range("C4:D5").Copy Workbooks.Open Filename:=d & "\secondfile.xlsx" Range("F13").Select ActiveSheet.Paste Application.CutCopyMode = False ActiveWorkbook.Save ActiveWorkbook.Close End Sub
"C4:D5" can be changed to a range name or your desired range address
"F13" can be changed to a range name or your desired range address
"secondfile.xlsx" can be changed to your desired name
I hope this helps
Jan-13 | Feb-13 | Mar-13 | Apr-13 | May-13 | Jun-13 | Jul-13 | Aug-13 | Sep-13 | Oct-13 | Nov-13 | Dec-13 | |
Flotte | ||||||||||||
Total number of users: | ||||||||||||
Total number of BIP: | ||||||||||||
Total number of BlackBerry: | ||||||||||||
Total number of Smartphones | ||||||||||||
Voice |