|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 hahazeng 于 2018-8-2 16:31 编辑
大家好,我想用VB在单元格输入=sumif(zi:zj, "T "wi:zj)*(1-Sheet03.Cells(11, 7))*IF(Sheet8.Cells(k + 1, 26) = "K",1.1,1)语句如下:
其中i、j、k是变量
语句:Sheet8.Cells(k + 4, 23).Formula = "= SUMIF(Z" & i & ":Z" & j & "," & """T""" & "," & "W" & i & ":W" & j & ")*(1-" & Sheet03.Cells(11, 7) * 100 & "%)*if(" & Sheet8.Cells(k + 1, 26) = "K" & ",1,1.1)"
结果不正确,结果是个“flase”
如果Sheet8.Cells(k + 4, 23).Formula = "= SUMIF(Z" & i& ":Z" & j & "," & """T""" & "," & "W" & i & ":W" & j & ")*(1-" & Sheet03.Cells(11, 7) * 100 & "%)”
结果=sumif(zi:zj, "T "wi:zj)*(1-Sheet03.Cells(11, 7)),结果正确
请问如何把“*IF(Sheet8.Cells(k + 1, 26) = "K",1.1,1)”添加到语句中?
|
|