本帖最后由 jk0932 于 2015-5-13 22:50 编辑
现在要判断在.cells(j,u)不为空且满足 Cells(j, t) > .Cells(j, u)则将Cells(j, u)的值赋给Cells(j, t)
个人写的代码如下:
If and(.cells(j,u)<>"" ,Cells(j, t) > .Cells(j, u))=1 Then .Cells(j, t) = .Cells(j, u)
运行出错,
求解答:
现在要判断在.cells(j,u)不为空且满足 Cells(j, t) > .Cells(j, u)则将Cells(j, u)的值赋给Cells(j, t)
个人写的代码如下:
if .cells(j,u)<>"" and .cells(j,t)>.cells(j,u) then .cells(j,t)=.cells(j,u)
红色如果不是变量是列号的话,要全部加双引号 如 "u"
cells前的 . 应该是在with语句下,如果不是,前面不需要 .
|