Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
アクティブな列の最初のセルが「abc」でない場合、終了しようとしています
If Not Cells(1, ActiveCell.Column).Value = "abc" Then Exit Sub MsgBox ("323")
アクティブな列の最初のセルが何であれ、MsgBox は表示されません。
どうですか
If Cells(1, ActiveCell.Column).Value <> "abc" Then Exit Sub MsgBox ("323")
メッセージボックスが呼び出される前にサブを終了しています。msgbox を呼び出して、サブルーチンを終了します。