Sub 奖励()
j = Sheets("1月27日").UsedRange.Columns.Count '获取总行数
For i = 2 To j '第二行开始循环 循环j次
l = Trim(Range("B" &i).Value) '获取B列i行数据
b = Trim(Range("D" &i).Value) '获取D列i行数据
If l >= 20000 And b >= 30 Then '当l大于等于20000且b大于等于30是 赋值g为128
g = 128
ElseIf l >= 30000 And b >= 30 Then '当l大于等于30000且b大于等于30是 赋值g为228
g = 228
Else
g = "" '其他赋值g为空值
End If
Range("F" &i).value=g '赋值给F列i行数据
Next
End Sub
Sub 保存属性()Dim y As Object, j As Byte
For Each y In Worksheets("资料面").OLEObjects
If InStr(y.Name, "CommandButton") Then
j = Replace(y.Name, "CommandButton", "")
Worksheets("保存").Range("C" &(x - 1) * 20 + j - 1) = y.Enabled
End If
Next
End Sub
Sub 读取保存数据()
Dim y As Object, j As Byte
For Each y In Worksheets("资料面").OLEObjects
If InStr(y.Name, "CommandButton") Then
j = Replace(y.Name, "CommandButton", "")
y.Enabled = Worksheets("保存").Range("C" &(x - 1) * 20 + j - 1)
End If
Next
End Sub
sub 宏1()for i= 2 to [a65536].end(xlup).row
cells(i,3)=cells(i,1)+cells(i,2)
if cells(i,1)+cells(i,2)<>20 then
cells(i,4)=""
cells(i,2)=0
esle
cells(i,4)=1
end if
next
end sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)