Excel VBA 質問スレ Part83 (765レス)
上下前次1-新
抽出解除 レス栞
リロード規制です。10分ほどで解除するので、他のブラウザへ避難してください。
417(3): 07/17(木)08:47 ID:sGHKyXGW(1) AAS
>>410
Dirでワイルドカードが使えるので、こんな感じに仕上げてみた
※ヒットするパスの例 → C:\Documents\A001\B000X1\Excel\20250717\FileABC001.xlsx
HomePath = "C:\Documents"
SearchPath = "A???\B*\Excel\2025????\File*.xlsx"
ResultPath = HomePath
SearchPathList = Split(SearchPath, "\")
For I = 0 To UBound(SearchPathList)
If Dir(ResultPath) <> "" Then
ResultPath = "ファイルの下は何もないよ!"
Exit For
End If
FolderName = Dir(ResultPath & "\" & SearchPathList(I), vbDirectory)
If FolderName = "" Then
ResultPath = "そんなパスはないよ!"
Exit For
End If
ResultPath = ResultPath & "\" & FolderName
Next
MsgBox "これかな?" & vbCrLf & ResultPath
419: 07/17(木)20:37 ID:zBpNwhAR(2/4) AAS
>>417
正規表現の様な事ができたのでしょうか?
421: 07/17(木)21:05 ID:zBpNwhAR(4/4) AAS
>>417
本当に複数の階層で部分一致できますでしょうか?
426: 07/18(金)08:22 ID:avd6O0J8(1) AAS
AA省
上下前次1-新書関写板覧索設栞歴
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル
ぬこの手 ぬこTOP 0.026s