I am trying to do an import of data where the amount of items will change daily and I will only have to run the macro to copy the data over to the workbook. What I current have works. I just believe that this is not the most efficient way. I would like to also be able to clear the sheet before copying over the new data.
Sub Data()
Application.ScreenUpdating = False 'Disables "Screen flashing" between 2 workbooks
Dim colA As Integer, colAA As Integer
Dim colB As Integer, colBB As Integer
Dim colC As Integer, colCC As Integer
Dim colD As Integer, colDD As Integer
Dim colE As Integer, colEE As Integer
Dim colF As Integer, colFF As Integer
Dim colG As Integer, colGG As Integer
Dim colH As Integer, colHH As Integer
Dim colI As Integer, colII As Integer
Dim colJ As Integer, colJJ As Integer
Dim colK As Integer, colKK As Integer
Dim colL As Integer, colLL As Integer
Dim colM As Integer, colMM As Integer
Dim colN As Integer, colNN As Integer
Dim colO As Integer, colOO As Integer
Dim rowA As Integer, rowAA As Integer
Dim rowB As Integer, rowBB As Integer
Dim rowC As Integer, rowCC As Integer
Dim rowD As Integer, rowDD As Integer
Dim rowE As Integer, rowEE As Integer
Dim rowF As Integer, rowFF As Integer
Dim rowG As Integer, rowGG As Integer
Dim rowH As Integer, rowHH As Integer
Dim rowI As Integer, rowII As Integer
Dim rowJ As Integer, rowJJ As Integer
Dim rowK As Integer, rowKK As Integer
Dim rowL As Integer, rowLL As Integer
Dim rowM As Integer, rowMM As Integer
Dim rowN As Integer, rowNN As Integer
Dim rowO As Integer, rowOO As Integer
Dim wbA As Workbook, wbB As Workbook
Dim bws As Worksheet
Set wbA = Workbooks.Open("C:\Users\Carrak\Desktop\Data\New Format\Maximo.xlsx.")
Set wbB = ThisWorkbook
colAA = 1 'Replace "1" with the number of the column FROM which you're copying
colBB = 45 'Replace "1" with the number of the column FROM which you're copying
colCC = 6 'Replace "1" with the number of the column FROM which you're copying
colDD = 7 'Replace "1" with the number of the column FROM which you're copying
colEE = 8 'Replace "1" with the number of the column FROM which you're copying
colFF = 9 'Replace "1" with the number of the column FROM which you're copying
colGG = 10 'Replace "1" with the number of the column FROM which you're copying
colHH = 11 'Replace "1" with the number of the column FROM which you're copying
colII = 28 'Replace "1" with the number of the column FROM which you're copying
colJJ = 31 'Replace "1" with the number of the column FROM which you're copying
colKK = 34 'Replace "1" with the number of the column FROM which you're copying
colLL = 53 'Replace "1" with the number of the column FROM which you're copying
colMM = 54 'Replace "1" with the number of the column FROM which you're copying
colNN = 55 'Replace "1" with the number of the column FROM which you're copying
colOO = 56 'Replace "1" with the number of the column FROM which you're copying
colA = 1 'Replace "1" with the number of the column TO which you're copying
colB = 3 'Replace "1" with the number of the column TO which you're copying
colC = 5 'Replace "1" with the number of the column TO which you're copying
colD = 6 'Replace "1" with the number of the column TO which you're copying
colE = 7 'Replace "1" with the number of the column TO which you're copying
colF = 8 'Replace "1" with the number of the column TO which you're copying
colG = 9 'Replace "1" with the number of the column TO which you're copying
colH = 10 'Replace "1" with the number of the column TO which you're copying
colI = 11 'Replace "1" with the number of the column TO which you're copying
colJ = 12 'Replace "1" with the number of the column TO which you're copying
colK = 13 'Replace "1" with the number of the column TO which you're copying
colL = 14 'Replace "1" with the number of the column TO which you're copying
colM = 15 'Replace "1" with the number of the column TO which you're copying
colN = 16 'Replace "1" with the number of the column TO which you're copying
colO = 17 'Replace "1" with the number of the column TO which you're copying
rowAA = 2 'Replace "1" with the number of the starting row of the column FROM which you're copying
rowAA = 2 'Replace "1" with the number of the starting row of the column FROM which you're copying
rowAA = 2 'Replace "1" with the number of the starting row of the column FROM which you're copying
rowAA = 2 'Replace "1" with the number of the starting row of the column FROM which you're copying
rowAA = 2 'Replace "1" with the number of the starting row of the column FROM which you're copying
rowAA = 2 'Replace "1" with the number of the starting row of the column FROM which you're copying
rowAA = 2 'Replace "1" with the number of the starting row of the column FROM which you're copying
rowAA = 2 'Replace "1" with the number of the starting row of the column FROM which you're copying
rowAA = 2 'Replace "1" with the number of the starting row of the column FROM which you're copying
rowAA = 2 'Replace "1" with the number of the starting row of the column FROM which you're copying
rowAA = 2 'Replace "1" with the number of the starting row of the column FROM which you're copying
rowAA = 2 'Replace "1" with the number of the starting row of the column FROM which you're copying
rowAA = 2 'Replace "1" with the number of the starting row of the column FROM which you're copying
rowAA = 2 'Replace "1" with the number of the starting row of the column FROM which you're copying
rowAA = 2 'Replace "1" with the number of the starting row of the column FROM which you're copying
rowA = 2 'Replace "1" with the number of the row of the column TO which you're copying
rowB = 2 'Replace "1" with the number of the row of the column TO which you're copying
rowC = 2 'Replace "1" with the number of the row of the column TO which you're copying
rowD = 2 'Replace "1" with the number of the row of the column TO which you're copying
rowE = 2 'Replace "1" with the number of the row of the column TO which you're copying
rowF = 2 'Replace "1" with the number of the row of the column TO which you're copying
rowG = 2 'Replace "1" with the number of the row of the column TO which you're copying
rowH = 2 'Replace "1" with the number of the row of the column TO which you're copying
rowI = 2 'Replace "1" with the number of the row of the column TO which you're copying
rowJ = 2 'Replace "1" with the number of the row of the column TO which you're copying
rowK = 2 'Replace "1" with the number of the row of the column TO which you're copying
rowL = 2 'Replace "1" with the number of the row of the column TO which you're copying
rowM = 2 'Replace "1" with the number of the row of the column TO which you're copying
rowN = 2 'Replace "1" with the number of the row of the column TO which you're copying
rowO = 2 'Replace "1" with the number of the row of the column TO which you're copying
wbA.Activate
lastAA = Cells(Rows.Count, colAA).End(xlUp).Row 'This finds the last row of the data of the column FROM which you're copying
For x = rowAA To lastAA 'Loops through all the rows of A
wbA.Activate
yourData = Cells(x, colAA)
wbB.Sheets("Data").Activate
Cells(rowA, colA) = yourData
rowA = rowA + 1 'Increments the current line of destination workbook
Next x 'Skips to next row
For x = rowAA To lastAA 'Loops through all the rows of A
wbA.Activate
yourData = Cells(x, colBB)
wbB.Sheets("Data").Activate
Cells(rowB, colB) = yourData
rowB = rowB + 1 'Increments the current line of destination workbook
Next x 'Skips to next row
For x = rowAA To lastAA 'Loops through all the rows of A
wbA.Activate
yourData = Cells(x, colCC)
wbB.Activate
Cells(rowC, colC) = yourData
rowC = rowC + 1 'Increments the current line of destination workbook
Next x 'Skips to next row
For x = rowAA To lastAA 'Loops through all the rows of A
wbA.Activate
yourData = Cells(x, colDD)
wbB.Activate
Cells(rowD, colD) = yourData
rowD = rowD + 1 'Increments the current line of destination workbook
Next x 'Skips to next row
For x = rowAA To lastAA 'Loops through all the rows of A
wbA.Activate
yourData = Cells(x, colEE)
wbB.Activate
Cells(rowE, colE) = yourData
rowE = rowE + 1 'Increments the current line of destination workbook
Next x 'Skips to next row
For x = rowAA To lastAA 'Loops through all the rows of A
wbA.Activate
yourData = Cells(x, colFF)
wbB.Activate
Cells(rowF, colF) = yourData
rowF = rowF + 1 'Increments the current line of destination workbook
Next x 'Skips to next row
For x = rowAA To lastAA 'Loops through all the rows of A
wbA.Activate
yourData = Cells(x, colGG)
wbB.Activate
Cells(rowG, colG) = yourData
rowG = rowG + 1 'Increments the current line of destination workbook
Next x 'Skips to next row
For x = rowAA To lastAA 'Loops through all the rows of A
wbA.Activate
yourData = Cells(x, colHH)
wbB.Activate
Cells(rowH, colH) = yourData
rowH = rowH + 1 'Increments the current line of destination workbook
Next x 'Skips to next row
For x = rowAA To lastAA 'Loops through all the rows of A
wbA.Activate
yourData = Cells(x, colII)
wbB.Activate
Cells(rowI, colI) = yourData
rowI = rowI + 1 'Increments the current line of destination workbook
Next x 'Skips to next row
For x = rowAA To lastAA 'Loops through all the rows of A
wbA.Activate
yourData = Cells(x, colJJ)
wbB.Activate
Cells(rowJ, colJ) = yourData
rowJ = rowJ + 1 'Increments the current line of destination workbook
Next x 'Skips to next row
For x = rowAA To lastAA 'Loops through all the rows of A
wbA.Activate
yourData = Cells(x, colKK)
wbB.Activate
Cells(rowK, colK) = yourData
rowK = rowK + 1 'Increments the current line of destination workbook
Next x 'Skips to next row
For x = rowAA To lastAA 'Loops through all the rows of A
wbA.Activate
yourData = Cells(x, colLL)
wbB.Activate
Cells(rowL, colL) = yourData
rowL = rowL + 1 'Increments the current line of destination workbook
Next x 'Skips to next row
For x = rowAA To lastAA 'Loops through all the rows of A
wbA.Activate
yourData = Cells(x, colMM)
wbB.Activate
Cells(rowM, colM) = yourData
rowM = rowM + 1 'Increments the current line of destination workbook
Next x 'Skips to next row
For x = rowAA To lastAA 'Loops through all the rows of A
wbA.Activate
yourData = Cells(x, colNN)
wbB.Activate
Cells(rowN, colN) = yourData
rowN = rowN + 1 'Increments the current line of destination workbook
Next x 'Skips to next row
For x = rowAA To lastAA 'Loops through all the rows of A
wbA.Activate
yourData = Cells(x, colOO)
wbB.Activate
Cells(rowO, colO) = yourData
rowO = rowO + 1 'Increments the current line of destination workbook
Next x 'Skips to next row
Application.ScreenUpdating = True 'Re-enables Screen Updating
End Sub