回答編集履歴

1

追記

2022/07/02 03:30

投稿

jinoji
jinoji

スコア4585

test CHANGED
@@ -8,3 +8,16 @@
8
8
  objFso.CreateFolder (ThisWorkbook.Path & "\注文書2022" & "\" & Range("AA11") & "\" & Range("AA11") & Format(Date, "yyyy.mm"))
9
9
  End If
10
10
  ```
11
+ ---
12
+ <追記>
13
+ 少し書き換えてみました。
14
+ ```
15
+ Dim wPath, wSubPath
16
+ wPath = ThisWorkbook.Path & "\注文書2022" & "\" & xRg.Value
17
+ wSubPath = wPath & "\" & xRg.Value & Format(Date, "yyyy.mm")
18
+
19
+ If Not objFso.FolderExists(wPath) Then objFso.CreateFolder wPath
20
+ If Not objFso.FolderExists(wSubPath) Then objFso.CreateFolder wSubPath
21
+
22
+ ```
23
+