乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > <em>excel</em> 循环判断语句 使用-excel if 循环语句,excel if条

<em>excel</em> 循环判断语句 使用-excel if 循环语句,excel if条

作者:乔山办公网日期:

返回目录:excel表格制作


Dim i%, a%
a = Sheets("source data from 201010 to (2)").Range("h1").CurrentRegion.Rows.Count
For i = 2 To a
If Cells(i, 6).Value = "NB" Then
Cells(i, 1) = Cells(i, 6).Value
Cells(i, 2) = Cells(i, 7).Value
Cells(i, 3) = Cells(i, 8).Value

END IF
Next i

没有END IF朋友

2007以上版本直接在H2单元格输入以下公式,然后向右向下填充公式
=IFERROR(VLOOKUP($G2,$B:$D,COLUMN(B1),0),0)

2003以下版本直接在H2单元格输入以下公式,然后向右向下填充公式
=IF(ISERROR(VLOOKUP($G2,$B:$D,COLUMN(B1),0)),VLOOKUP($G2,$B:$D,COLUMN(B1),0),0)
没看懂你的行列关系,我猜是不是这样
sub test()
for i=35 to 52
if range("A"&i)="new" o rrange("A"&i)="obs" or range("A"&i)="dal" then
range("l"&i).locked=true
range("k"&i).locked=true
elseif
range("A"&i)="add" o rrange("A"&i)="exp" or range("A"&i)="rev" then
range("c"&i).locked=true
range("h"&i).locked=true
end if
next
end sub

干嘛还用IF,直接用
=固定值+RAND()
不就可以了?固定值可以输入数字,或者引用某个单元格

相关阅读

关键词不能为空
极力推荐

ppt怎么做_excel表格制作_office365_word文档_365办公网