I’m stumped. I have a table like below and want to paste in col H (col7) the column heading of the maximum of the absolute values of col1-col6. For example at note1 col 7 returns “col1” while at note12 col7 returns “col2”. I would then like to shade the cell (b12:G12) containing that max abs value
col1 col2 col3 col4 col5 col6
note1 0.1289 -0.0018 0.0550 -0.0573 0.0696 -0.0531
note2 -0.0181 0.2228 0.1183 -0.1510 -0.0591 0.2506
note3 0.0343 0.2273 0.0095 -0.0462 -0.1293 -0.0976
note4 -0.0050 0.1239 -0.0188 0.1461 0.1208 0.2842
note5 0.1587 -0.0460 0.0355 0.0506 -0.0228 0.0233
note6 0.0081 -0.1456 0.2167 0.1139 -0.0092 -0.1686
note10 0.0923 0.1325 -0.0945 0.1292 0.0508 0.0983
note11 0.0792 0.1356 -0.0014 0.1778 0.0622 0.1221
note12 0.0007 -0.2235 0.0320 0.0552 -0.0925 -0.0465
The following formula does everything except finding ABS(B12:G12)
=CELL("contents",INDEX($B$1:$G$1,MATCH(MAX(B12:G12),B12:G12,0)))
but need to generalize this uto a vba routine. Can you help?
col1 col2 col3 col4 col5 col6
note1 0.1289 -0.0018 0.0550 -0.0573 0.0696 -0.0531
note2 -0.0181 0.2228 0.1183 -0.1510 -0.0591 0.2506
note3 0.0343 0.2273 0.0095 -0.0462 -0.1293 -0.0976
note4 -0.0050 0.1239 -0.0188 0.1461 0.1208 0.2842
note5 0.1587 -0.0460 0.0355 0.0506 -0.0228 0.0233
note6 0.0081 -0.1456 0.2167 0.1139 -0.0092 -0.1686
note10 0.0923 0.1325 -0.0945 0.1292 0.0508 0.0983
note11 0.0792 0.1356 -0.0014 0.1778 0.0622 0.1221
note12 0.0007 -0.2235 0.0320 0.0552 -0.0925 -0.0465
The following formula does everything except finding ABS(B12:G12)
=CELL("contents",INDEX($B$1:$G$1,MATCH(MAX(B12:G12),B12:G12,0)))
but need to generalize this uto a vba routine. Can you help?