[英]given a martix, use its row/column headers to find the corresponding value
so this is how an example of how my data looks like in sheet to now I would like to write a macro which does: Takes the row header (say A1 at sheet1 is value3) Takes the column header (say A2 at sheet1 is header2) so the value of A3 should be 0.918768 at sheet1. 所以这就是我的数据在工作表中看起来如何的一个例子现在我想编写一个宏来做:获取行标题(比如说Sheet1的A1是value3)采用列标题(比如说sheet1的A2是header2)所以在Sheet1,A3的值应为0.918768。
I guess I can count until a certain header/value is found and address to it but is there an easy way to look up? 我想我可以算一下,直到找到某个标题/值并解决它但是有一个简单的查找方法吗?
It sounds like the INDEX
and MATCH
worksheet functions might be a solution. 听起来像INDEX
和MATCH
工作表函数可能是一个解决方案。 For example, in your second screen capture, the formula in cell C1 could be something like =INDEX(Sheet1!$B$2:$F$6,MATCH(A1,Sheet1!$A$2:$A$6,0),MATCH(B1,Sheet1!$B$1:$F$1,0))
. 例如,在第二个屏幕截图中,单元格C1中的公式可能类似于=INDEX(Sheet1!$B$2:$F$6,MATCH(A1,Sheet1!$A$2:$A$6,0),MATCH(B1,Sheet1!$B$1:$F$1,0))
。
您可以使用Find for the value,抓住它的ActiveCell,然后只查找((ActiveRow):1)和(1:(ActiveColumn))。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.