Private Sub CommandButton1_Click()
Dim myNumber
Dim myStrg1 As String
Dim myStrg2 As String
Dim i
myNumber = Len(ComboBox1.Text) '文字数をカウント
myStrg1 = ""
myStrg2 = ""
For i = 1 To myNumber '文字を「*」に置換する
myStrg1 = myStrg1 & "*"
myStrg2 = myStrg1
Next i
MsgBox ComboBox1.Text & " ---> " & myStrg1
TextBox2.Text = Replace(TextBox1.Text, ComboBox1.Text, "[ " & myStrg1 & " ]", , , 1)
End Sub
|