Sub Sample() Dim str As String, length As Integer str = InputBox("文字列を入力してください") length = InputBox("文字数を入力してください") MsgBox Left(str, length) End Sub