The function of the following code is to merge all the remaining worksheets in the same workbook, appending the rest of the table's data to the first worksheet to form a complete unique table of data.
The code is as follows, and a code note will be attached later:
Dim Mycount as Integer
K = Worksheets (1). UsedRange.Rows.Count + 1
For MyTable = 2 to Worksheets.count
For i = 5 to Worksheets (MyTable). UsedRange.Rows.Count
For j = 1 to Worksheets (MyTable). UsedRange.Columns.Count
Worksheets (1). Cells (k, J). Value = Worksheets (MyTable). Cells (i, J). Value
Next J
K = k + 1
Next I
Next MyTable
Note that, as in the code above, only the fifth row of the other table's data to the last row of the data array added to the first table, the first row to the fourth row is the title, no append. For i = 5 represents the start of the array from line fifth.
Code explanation
K = Worksheets (1). UsedRange.Rows.Count + 1 Gets the line number of the last row of the first worksheet plus 1
For MyTable = 2 to Worksheets.count from the second worksheet to the last worksheet, so that you can append additional tables to the first table by looping
For i = 5 to Worksheets (MyTable). UsedRange.Rows.Count each worksheet, append to table one only from line fifth to the last row of valid data.
For j = 1 to Worksheets (MyTable). UsedRange.Columns.Count loops from the first column of each worksheet to the maximum column number of valid column data.
Worksheets (1). Cells (k, J). Value = Worksheets (MyTable). Cells (i, J). Value assigns the values of the cells of the valid data for other tables to the corresponding cells in the first worksheet.