Sub micro()
Dim x As Integer
For x = 1 To 100
If Cells(i, 1)=1 then
不 Rows(x).Clear
else Rows(x).Clear
End If
Next x
End Sub
If Cells(x, 1)=1 then
“不删除”某行怎么写
“保留某行”怎么写
vba否定怎么表达
答案:2 悬赏:10
解决时间 2021-02-19 19:30
- 提问者网友:情系雨樱花
- 2021-02-19 00:21
最佳答案
- 二级知识专家网友:统治我的世界
- 2021-02-19 01:32
你这个micro不对,没法运行的,没有给i 赋值
还有不是很明白你的意思 你是想当cells(i,1)=1的时候不删除rows(x),当cells(i,1)<>1的时候删除rows(x)吗?
这样的话 你直接写成 if cells(i,1)<>1 then rows(x).delete 就可以了
或者:
if cells(i,1)=1 then
else: rows(x).delete
end if
保留和不删除的话什么都不用写啊,因为没有变化说以什么都不用写
还有不是很明白你的意思 你是想当cells(i,1)=1的时候不删除rows(x),当cells(i,1)<>1的时候删除rows(x)吗?
这样的话 你直接写成 if cells(i,1)<>1 then rows(x).delete 就可以了
或者:
if cells(i,1)=1 then
else: rows(x).delete
end if
保留和不删除的话什么都不用写啊,因为没有变化说以什么都不用写
全部回答
- 1楼网友:一只傻青衣
- 2021-02-19 02:35
If Cells(i, 1)=1 then
不 Rows(x).Clear
else Rows(x).Clear
End If
改成:
If Cells(i, 1)<>1 then
Rows(x).Clear
else Rows(x).Clear
End If
再看看别人怎么说的。
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯