In a different question, a follow on to this :
I now need loop through all rows in a worksheet, output cell values in a specified column order based on values in Row 1:
Study Filo Mean Olp Std Dev Bell
Sun 9 29.998 77 33.887 G
Mercury 66 30.686 29 37.03 R
Venus 53 993.09 65 643 H
Earth 44 44.099 22 34.06 J
Mars 78 77.94 90 22.796 B
For instance, beginning with row 2, output the cell value of the column with the 'label' of Mean [29.988]
then the cell value of the column of 'Std Dev' [33.887]
then the cell value of the column of 'Study' [Sun]
Then continue processing the remainder of the rows in the worksheet.
At first, it seems to be simple, alas not so much: lookup the value of row [r], column[x] where column heading is [Mean]. Repeat for heading [Std Dev] and then heading [Study], regardless of the column order.
and I have no way of knowing the sheet name, or even how many columns there are in the sheet, just that the columns have those headings. I have tried hlookup, but can't seem to get it to work when searching for the heading columns, and I am not convinced that hlookup is the correct function to use.
Hope this is clear, and thanks for looking.