sub summ() dim nrow as integer dim nn as integer dim i as integer dim sumall as single dim nplus as integer dim sumplus as single dim temp as single dim st as long dim en as long i=2 temp=0 st=range("a2") do while cells(i,4)<>" if cells(i,4)="买入"then temp=temp-cells(i,5) if ... 20210311
1、电脑打开excel表格,按alt+f11进入宏。2、进入宏后,点击插入模块。3、点击插入模块后,输入代码 function sumcolor(rag1 as range,rag2 as range) application.volatile for each i in rag2 if i.interior.colorindex=rag1.interior.colorindex then sum...