Hi,
I'm a beginner to VBA programming and macros and I think I have a scenario that is a little out of my league. Looking for assistance/direction or suggestions. It is even a little difficult to explain, but here goes.
I am looking to copy non contiguous columns from a worksheet to another worksheet in the same workbook. For example, copying columns A, B, C and column F then looping through again to append to that list in the new spreadsheet, columns A, B, C and column G and so on for the range F2:H2.
I would suspect the logic may be something like this:
for i = (F2 to H2)
for j = (row 4 to row 100) ** the number or rows is not static, it could vary due to insertions and deletions. **
F2, row 4 ** create new row **
F2, row 5 ** create new row **
....
G2, row 4
G2, row 5
The row that is copied would select cells from non contiguous columns in the original spreadsheet. Perhaps, copying out the whole row would be easiest then deleting the necessary columns.
I have attached an example of the worksheet and what the new spreadsheet should look like.
Thanks!
KevinSample data.xlsx
Bookmarks