掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
改行させないには? (ID:77718)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
Public Function ReplaceText(ByVal srcText As String) As String Dim SearchPos As Long Dim chgText As String Dim tgtText As String SearchPos = 1 chgText = "" tgtText = vbCrLf Dim FoundPos As Long Do '被交換文字列検索 FoundPos = InStr(SearchPos, srcText, vbCrLf) '検索文字列が見つからなかったらループ終了 If FoundPos = 0 Then Exit Do '次回検索位置算出 SearchPos = FoundPos + Len(chgText) '文字列置換 srcText = Left$(srcText, FoundPos - 1) & chgText & Mid$(srcText, FoundPos + Len(tgtText)) Debug.Print srcText Loop '編集した文字列を返す ReplaceText2 = srcText End Function 出来ました ペコリ
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.