Private Sub CommandButton1_Click()Dim i As SingleFor i = 1 To 200If Cells(i, 1) = "城市" Then Cells(i, 2).Value = 2End IfNext iEnd Sub
2 回答
阿晨1998
TA贡献2037条经验 获得超6个赞
改成:
Private Sub CommandButton1_Click()
Dim i As Single
For i = 1 To 200
If Cells(i, 1) = "城市" Then Cells(i, 2).Value = 2
Next i
End Sub
或者:
Private Sub CommandButton1_Click()
Dim i As Single
For i = 1 To 200
If Cells(i, 1) = "城市" Then
Cells(i, 2).Value = 2
End If
Next i
End Sub
- 2 回答
- 0 关注
- 52 浏览
添加回答
举报
0/150
提交
取消