跟本用不着宏,设置允许循环引用(回归次数)后,直接用if语句即可。在c1单元格输入:=if(a1+b1=0,"",a1+b1)
不明白你为什么要用VBA,用公式倒是很容易实现,在C1单元格输入公式:=if(A1+B1=0,"","A1+B1")
sub x() if [a1]+[b1]=0 then [c1]="" else [c1]="=a1+b1" end ifend sub
=IF(A1+B1=0,"",A1+B1)下拉公式