I have 300 separate workbooks that are formatted the same and want to take certain fields in each and write to one workbook so I can import an infile to SAS and run reports. I know how to do a macro to simple copy and paste but you have to know the name of each book and have them open and I have 300 separate workbooks all named different because they are sent in from various hospitals.
example: my book is called simply macro 1 hospital book is johnhopkins, another is centralflorida and so on
a possible code is:
johnhopkins.worksheets("sheet1").range("a1:g2").copy workbooks("macro.xslx").worksheets("sheet1").range("a1").insert shift:x1down
the problem is I want to copy and paste certain cells, not all in the workbook I am given to my single workbook and I am not sure how to select the cells I want from what they are sending. They are actuall cells B5, b8, g13, i13, j13, k13, l13
and I want to copy them to a1 through g2 on my workbook.
then the other problem is the workbooks are all named differently, all 300 of them. Is there a macro to just copy the workbooks i have opened without putting in the actual name everytime?