Hi again,
I have been very successful in this forum when asking for help. So thanks in advance for the following.
I have two sheets and I am copying values from sheet 1 to sheet 2. The values to copy are based on the column titles, row 6 in sheet 1 and row 2 in sheet 2.
The formula I am using to populate sheet 1 is the following because sometimes the titles change places
=INDIRECT(ADDRESS(ROW(E3),MATCH(E$6,Sheet2!$2:$2,0),,,"Sheet2"))
The problem is that I have to copy down the formula manually. What I would like to have is some sort of VBA code that copies the values depending on the size of the columns in sheet 2. i.e. until it finds a blank row in sheet 2.
Note: the code should be able to understand when the columns change the titles position, as it is doing now.
sheet1
sheet1.jpg
sheet 2
sheet2.jpg
Thank you,
Pedro
Bookmarks