大家好,乐天来为大家解答以下的问题,关于excel表格制作方法,excel宏公式这个很多人还不知道,现在让我们一起来看看吧!
1、Sub 录制宏() Range("C2").Select ActiveCell.FormulaR1C1 = _ "=IF(SUMPRODUCT((Sheet2!C[-2]:C=RC[-1])*COLUMN(Sheet2!C[-2]:C))=0,"""",IF(SUMPRODUCT((Sheet2!C[-2]:C=RC[-1])*COLUMN(Sheet2!C[-2]:C))=1,INDEX(Sheet2!C[-2]:C,SUMPRODUCT((Sheet2!C[-2]:C=RC[-1])*ROW(Sheet2!C[-2]:C)),2),IF(SUMPRODUCT((Sheet2!C[-2]:C=RC[-1])*COLUMN(Sheet2!C[-2]:C))=2,INDEX(Sheet2!C[-2]:C,SUMPRODUCT((Sheet2!C[-2]:C=RC[-1])*ROW(Sheet2!C[-2]:C)),1),IF(SUMPRODUCT((Sheet2!C[-2]:C=RC[-1])*COLUMN(Sheet2!C[-2]:C))=3,INDEX(Sheet2!C[-2]:C,SUMPRODUCT((Sheet2!C[-2]:C=RC[-1])*ROW(Sheet2!C[-2]:C)),1)))))"End Sub。
本文分享完毕,希望对大家有所帮助。
标签:
免责声明:本文由用户上传,如有侵权请联系删除!