は、以下の機能が今 ELSEIFは、
Private Sub CommandButton1_Click()
Dim i As Integer
Dim value_s As String
i = 2
Do Until IsEmpty(Cells(i, 1))
value_s = ActiveSheet.Cells(i, 2)
If value_s <> "" Then
Debug.Print "value_s is not empty"
ElseIf value_s = "1200" Then
Debug.Print "value_s contains a 1200"
Else
Debug.Print "print the rest"
End If
i = i + 1
Loop
End Sub
を書かれている
+----------+-------+---------------+
| Option | value | VisibleOption |
+----------+-------+---------------+
| Option#1 | | #Option5 |
| Option#2 | | #Option6 |
| Option#3 | 3 | #Option7 |
| Option#4 | 1200 | #Option8 |
+----------+-------+---------------+
ファイルをスキップする機能は、次の
print the rest
print the rest
value_s is not empty
value_s is not empty
ことながら返します1200が存在するので、次のような値を返します。
print the rest
print the rest
value_s contains a 1200
value_s is not empty
value_s is not empty
ElseIfはスキップされているようです。ここで何がうまくいかない?
intを文字列と比較しています – Tom