| 
    
     |  | あ >シート内の文字をtxtファイルで2つ上のフォルダに保存
 ということだったのね・・見落としてました。
 解決済みのようですが、いちおうその線で私のサンプルも提示しておきます。
 
 Sub Make_MyTextFile()
 Dim x As Long, y As Long
 Dim MyR As Range, C As Range
 Dim NewPh As String, NewN As String
 
 With ActiveWorkbook
 x = InStrRev(.Path, "\", -1)
 y = InStrRev(.Path, "\", x - 1)
 NewPh = Left$(.Path, y)
 End With
 Do
 NewN = ""
 NewN = inputBox("作成するテキストファイルの名前を" & _
 vbLf & "拡張子なしで入力して下さい")
 NewN = NewPh & NewN & ".txt"
 If Dir(NewN) <> "" Then
 MsgBox "その名前のファイルは既に存在します", 48
 End If
 Loop While Dir(NewN) <> ""
 With Sheets("temp")
 Set MyR = .Range("A1", .Range("A65536").End(xlUp))
 End With
 Open NewN For OutPut Access Write As #1
 For Each C In MyR
 Print #1, C.Text
 Next
 Close #1: Set MyR = Nothing
 MsgBox NewN & vbLf & "を作成しました", 64
 End Sub
 
 |  |