I have about 300 lines of the following macro:
It copies from 6 different tables data to sheet1 in the same workbook.![]()
Sheets("Sheet1").Range("B2").Value = Sheets("Tabel 1").Range("C15").Value Sheets("Sheet1").Range("C2").Value = Sheets("Tabel 1").Range("D15").Value Sheets("Sheet1").Range("D2").Value = Sheets("Tabel 2").Range("C14").Value Sheets("Sheet1").Range("E2").Value = Sheets("Tabel 2").Range("D14").Value Sheets("Sheet1").Range("F2").Value = Sheets("Tabel 3").Range("C15").Value Sheets("Sheet1").Range("G2").Value = Sheets("Tabel 3").Range("D15").Value Sheets("Sheet1").Range("H2").Value = Sheets("Tabel 4").Range("H15").Value Sheets("Sheet1").Range("I2").Value = Sheets("Tabel 5").Range("C14").Value Sheets("Sheet1").Range("J2").Value = Sheets("Tabel 5").Range("D14").Value Sheets("Sheet1").Range("K2").Value = Sheets("Tabel 6").Range("I15").Value
Now I would like to change it so that it will copy the data to another workbook I have open. The name of the new workbook is “Andmed” (file name). Sheet name is still sheet1. The workbook name of the file where I will copy from will change as I need to run this macro about 200 times. I will probably run the macro from this workbook but store it in “Andmed” workbook.
Also before copying the data it should insert a new line to workbook “Andmed” sheet1 line2. To greate a space for the data as not to overwrite previous data.
All help will be greatly appreciated,
Bookmarks