|
ご教授の程、よろしくお願いします。
Sub 転送()
Dim myFso As Object
Dim path1 As String
Dim path2 As String
Dim path3 As String
Dim day As String
Dim oFilN1 As String
Dim nFilN1 As String
Debug.Print
Set myFso = CreateObject("Scripting.FileSystemObject")
'移動元ファイルの検索と移動先の指定
path1 = Range("C12")
day = InputBox("日付を入力して下さい")
If day <> Empty Then
day = CInt(day)
Else
Exit Sub
End If
oFilN1 = Dir(path1 & "\" & day & "\" & "N1.jpg")
nFilN1 = Workbooks("起動シート.xls").path
MsgBox oFilN1
If Not myFso.fileExists(filespec:=oFilN1) Then
myFso.MoveFile oFilN1, nFilN1
End If
Set myFso = Nothing
End Sub
|
|