Sub CreateResultTextFile()
Dim searchDate As String
Dim fileName As String
Dim filePath As String
Dim fileContent As String
' 検索日の取得
searchDate = Format(Date, "yyyymmdd")
' ファイル名の作成
fileName = "対象なし_" & searchDate & ".txt"
' ファイルパスの作成(保存先を適切な場所に変更してください)
filePath = ThisWorkbook.Path & "\" & fileName
' ファイル内容の作成
fileContent = "検索結果が見つかりませんでした。"
' テキストファイルを作成し保存
Open filePath For Output As #1
Print #1, fileContent
Close #1
MsgBox "テキストファイルが作成されました " & vbNewLine & vbNewLine & fileName
End Sub