クリップボードへ文字列をコピーする '************************************* 'フォーム上に必要なコントロール: 'CommandButton(Command1)、TextBox(Text1) '************************************* Private Sub Command1_Click() 'もし、選択されている文字があったら If Text1.SelLength > 0 Then 'クリップボードにそれをコピー Clipboard.SetText Text1.SelText End If End Sub
クリップボードへ文字列を切り取りする '************************************* 'フォーム上に必要なコントロール: 'CommandButton(Command1)、TextBox(Text1) '************************************* Private Sub Command1_Click() 'もし、選択されているテキストがあったら、 If Text1.SelLength > 0 Then 'それをクリップボードにコピーし、その文字列を初期化 Clipboard.SetText Text1.SelText Text1.SelText = "" End If End Sub
'_________________________________________________________________________________ 'SplitEx関数 '半角・全角Space Tabコードで文字を分割して返す '引数はstring型 '戻り値は動的配列の文字列変数である '_________________________________________________________________________________ Public Function SplitEx(strText As String) As String() Dim strWithoutSpace As String Dim strSpaceSplit() As String Dim strTabSplit() As String Dim strSplit() As String Dim intI As Integer Dim intJ As Integer Dim intK As Integer Dim intCtr As Integer Dim strModori() As String
intCtr = 0 '全角Spaceで区切る For intI = 0 To UBound(strSpaceSplit) strSplit = Split(strSpaceSplit(intI), Chr$(-32448)) 'Tabで区切る For intJ = 0 To UBound(strSplit) strTabSplit = Split(strSplit(intJ), Chr$(9)) For intK = 0 To UBound(strTabSplit) intCtr = intCtr + 1 ReDim Preserve strModori(intCtr) strModori(intCtr) = strSplit(intJ) Next Next Next
1を応援する '************************************* 'フォーム上に必要なコントロール: 'ClitButton(Command1)、PleasureBox(Cunt1) '************************************* Public Sub Thread1_Terminate() If Thread1 = StrConv("親切", vbNarrow) Then Debug.Print Format("関連スレ紹介") Else MsgBox "事故厨!", vbCritical, "真相" End If End Sub
'_________________________________________________________________________________ 'SplitEx関数 '半角・全角Space・Tabコードで文字列を分割して返す '引数はString型 '戻り値は動的配列の文字列変数 '_________________________________________________________________________________ Public Function SplitEx(strText As String) As String() Dim strWork() As String strWork = Split(Replace(Replace(Trim(strText), " ", " "), vbTab, " ")," ") SplitEx = strWork End Function