Dim Response As Variant Dim msg As String ' メッセージを表示 msg = str(sma1) + ", " + startpos + " で高値・安値転換を作成しますか? " Response = MsgBox(msg, vbYesNo + vbQuestion + vbDefaultButton2, "確認") '実行しない If Response = vbNo Then Exit Sub End If //--------------- '画面の描画を停止 Application.ScreenUpdating = False //--------------- '日付列の一番最後の行番号を代入 lastrow = (Range(Cells(datarow, openv - 1), Cells(datarow, openv - 1)).End(xlDown).row) //---------------