|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
如下宏和公式
Sub xiala()
Dim x
[f5]=[IF(LEN(B5)=3,IF(E5="借",VLOOKUP(B5,代码及期初余额表!$A$4:$E$97,5,0)+SUMPRODUCT((LEFT(凭证库!$D$2:$D$10000,3)=LEFT(B5,3))*(凭证库!$G$2:$G$10000))-SUMPRODUCT((LEFT(凭证库!$D$2:$D$10000,3)=LEFT(B5,3))*(凭证库!$H$2:$H$10000)),VLOOKUP(B5,代码及期初余额表!$A$4:$E$97,5,0)-SUMPRODUCT((LEFT(凭证库!$D$2:$D$10000,3)=LEFT(B5,3))*(凭证库!$G$2:$G$10000))+SUMPRODUCT((LEFT(凭证库!$D$2:$D$10000,3)=LEFT(B5,3))*(凭证库!$H$2:$H$10000))),IF(E5="借",VLOOKUP(B5,代码及期初余额表!$A$4:$E$97,5,0)+SUMPRODUCT((凭证库!$D$2:$D$10000=B5)*(凭证库!$G$2:$G$10000))-SUMPRODUCT((凭证库!$D$2:$D$10000=B5)*(凭证库!$H$2:$H$10000)),VLOOKUP(B5,代码及期初余额表!$A$4:$E$97,5,0)-SUMPRODUCT((凭证库!$D$2:$D$10000=B5)*(凭证库!$G$2:$G$10000))+SUMPRODUCT((凭证库!$D$2:$D$10000=B5)*(凭证库!$H$2:$H$10000))))]
x = Sheets("往来余额汇总表").[B65536].End(xlUp).Row
If x <= 5 Then Exit Sub
Range("F5").Select
Selection.AutoFill Destination:=Range("F5:F" & x), Type:=xlFillDefault
Range("F5:F" & x).Select
End Sub
请问:
如何将宏中的超长公式修改为VBA认可的形式,目前太长了VBA中无法执行!
|
|