, 당신은 원하는 기능을 지원하는 당신의 자신의에서 InputBox를 만들 수 있습니다. 내 이름은 CustomInputBox
입니다.
TextBox의 MultiLine 속성을 True로 설정하십시오.
예 :

는 다음과 같은 몇 가지 매개 변수를 사용하여에서 InputBox를 표시하는 버튼과 기능에 대한 몇 가지 논리를 추가 프롬프트 및 제목 :
Option Explicit
Private inputValue As String
Private Cancel As Boolean
Private Sub btnCancel_Click()
Cancel = True
Me.Hide
End Sub
Private Sub btnOK_Click()
If Me.txtInput.Value <> "" Then
inputValue = Me.txtInput.Value
End If
Me.Hide
End Sub
'This is the Function you are going to use to open your InputBox
Public Function Display(Prompt As String, Optional Title As String = "", Optional Default As String = "") As String
Cancel = False
Me.lblPrompt.Caption = Prompt
If Title <> "" Then
Me.Caption = Title
Else
Me.Caption = "Microsoft Excel"
End If
If Default <> "" Then
Me.txtInput.Value = Default
Else
Me.txtInput.Value = ""
End If
Me.txtInput.SetFocus
Me.Show vbModal
If Not Cancel Then
Display = inputValue
Else
Display = ""
End If
End Function
지금 당신은 할 수 있습니다 다음과 같이 InputBox를 사용하십시오.
Dim text As String
text = CustomInputBox.Display("Enter selected text here:")
우리를 만들어야합니다. 어 형태. –