标签: vba excel-vba excel
我有VBA问题。我想写一个If语句,我想说一个A> = B,然后在新列中的其他0 B-A。我想重复这一直到最后一行。任何人都可以帮助我
答案 0 :(得分:1)
怎么样:
Sub qwerty() Dim N As Long, r As Range N = Cells(Rows.Count, "A").End(xlUp).Row Set r = Range("C1:C" & N) r.Formula = "=IF(A1>=B1,0,B1-A1)" End Sub