改成:Private Sub CommandButton1_Click()Dim i As SingleFor i = 1 To 200If Cells(i, 1) = "城市" Then Cells(i, 2).Value = 2Next iEnd Sub或者:Private Sub CommandButton1_Click()Dim i As SingleFor i = 1 To 200If Cells(i, 1) = "城市" ThenCells(i, 2).Value = 2End IfNext iEnd Sub