Hi guys.
Not sure if this is a good thing.. I frequent the forum a lot but dont' really post too much as I usually tend to find my solutions on here.
There are quite a few threads on copy-pasting data between 2 workbooks but I unfortunately can't seem to extend that code to suit my needs.
I am trying to write a macro to do the following:
open 2 workbooks (path and filename changes each month). The user will select the files using getopenfilename.
Then I want the macro to copy specific cells from each of these workbooks (am ok to write my own code for this), and then paste it back in the third workbook, which is the active workbook where I'll be keeping the macro button to execute the code.
I'm not sure how to refer to the workbooks in the code.
I've tried something along these lines but can't seem to get it to work 
I've tried using the Windows.Activate code also but I suspect my syntax is wrong.
(I'm an accountant learning VBA from scratch, so please consider my skill level as beginner to VBA. Am very much above average user at non-VBA stuff though
able to write complex SUMPRODUCTS etc.)
Here is the code I compiled up to now.
This should be enough to give an idea of what I'm trying to achieve.
Sub codetest()
Dim BillCalcs As String 'this is the activeworkbook where info will be pasted
Dim MEWBC As String 'this is workbook 1 to copy from
Dim MEWBP As String 'this is workbook 2 to copy from
'specify which files to use as a source
MEWBC = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls*), *.xls*", Title:="Where is CURRENT Mth Wkbk")
MEWBP = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls*), *.xls*", Title:="Where is PRIOR Mth Wkbk")
Workbooks.Open (MEWBC), UpdateLinks:=0
Workbooks.Open (MEWBP), UpdateLinks:=0
'this is where it fails :(
Workbooks(MEWBC).Activate
Sheets("CUSTOMSHEETNAME").Select
range("B13:B100").Select
Selection.Copy
Workbooks(BillCalcs).Activate
ActiveSheet.Select
Selection.Paste
End Sub
Bookmarks