質問編集履歴
1
パスとファイル名を変更しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
VBAにてファイル名を一括変更したいです。
|
4
4
|
具体的には
|
5
|
-
xx01.txt →
|
5
|
+
xx01.txt → aaa_xx01.txt
|
6
|
-
xx02.txt →
|
6
|
+
xx02.txt → aaa_xx02.txt
|
7
|
-
xx03.txt →
|
7
|
+
xx03.txt → aaa_xx03.txt
|
8
|
-
xx04.txt →
|
8
|
+
xx04.txt → aaa_xx04.txt
|
9
|
-
xx05.txt →
|
9
|
+
xx05.txt → aaa_xx05.txt
|
10
10
|
という具合にファイル名を一括変更したいです。
|
11
11
|
|
12
12
|
### 発生している問題・エラーメッセージ
|
@@ -25,14 +25,14 @@
|
|
25
25
|
Dim i As Integer
|
26
26
|
Dim j As Integer
|
27
27
|
|
28
|
-
SourcePath = "\
|
28
|
+
SourcePath = "\C:abc\test\"
|
29
|
-
DestinationPath = "\
|
29
|
+
DestinationPath = "\D:123\test"
|
30
30
|
|
31
31
|
j = 1
|
32
32
|
|
33
33
|
For i = 1 To 5
|
34
34
|
Name SourcePath & "xx0" & "j" & ".txt" _
|
35
|
-
As DestinationPath & "
|
35
|
+
As DestinationPath & "aaa_xx0" & "j" & ".txt"
|
36
36
|
j = j + 1
|
37
37
|
Next i
|
38
38
|
|
@@ -53,10 +53,10 @@
|
|
53
53
|
Dim SourcePath As String
|
54
54
|
Dim DestinationPath As String
|
55
55
|
|
56
|
-
SourcePath = "\
|
56
|
+
SourcePath = "\C:abc\test\"
|
57
|
-
DestinationPath = "\
|
57
|
+
DestinationPath = "\D:123\test"
|
58
58
|
|
59
59
|
Name SourcePath & "xx01.txt" _
|
60
|
-
As DestinationPath & "
|
60
|
+
As DestinationPath & "aaa_xx01.txt"
|
61
61
|
|
62
62
|
End Sub
|