advanced help
per page, with , order by , clip by
Results of 1 - 1 of about 1437 for フォルダ 選択 (0.009 sec.)
フォルダ (4447), 選択 (24694)
[[20141125151837]]
#score: 4655
@digest: 42f2b559150c06c38d5eaa8ce436373e
@id: 66733
@mdate: 2014-11-25T12:58:41Z
@size: 2567
@type: text/plain
#keywords: 得fl (14010), isfolder (4741), 再選 (4525), fld (4517), folder (3900), ダパ (3668), dlg (3589), ォル (3006), 名取 (2931), ダ内 (2746), ルダ (2717), ス取 (2706), msofiledialogfolderpicker (2473), スdi (2354), optional (2323), ル名 (2200), filedialog (2118), フォ (2109), browseforfolder (2061), fl (2013), 名di (1841), ファ (1743), path (1569), 択可 (1528), 期値 (1512), パス (1418), ァイ (1265), fd (1160), selecteditems (1148), フル (1082), 取得 (1071), イル (1059)
『VBA フォルダパス取得およびフォルダ内のファイル名取得』(まあちゃ)
フォルダ選択するダイアログボックスを表示させて(ファイルも表示させて)任意のフォルダ選択したい。 そのフォルダパスとフォルダ内のファイル名取得したいのです。 msoFileDialogFolderPickerを使用すると、フォルダパスとフォルダ内のファイル名は取得できるのですが、ファイルが表示されません。 ファイルも表示させる方法ありませんか。 Sub test() Dim dlg As FileDialog Dim fd_path As String 'フォルダのフルパス Dim fl_name As String 'ファイル名 Dim i As Long 'ファイル名を出力する行番号 Set dlg = Application.FileDialog(msoFileDialogFolderPicker) With dlg .Title = "フォルダ選択してください" End With 'キャンセル時にはマクロを終了 If dlg.Show = False Then Exit Sub 'フォルダのフルパスを格納 fd_path = dlg.SelectedItems(1) 'フォルダ内の一つ目のファイル名を取得 fl_name = Dir(fd_path & "¥*") If fl_name = "" Then MsgBox fd_path & " にはファイルが存在しません。" Exit Sub End If Range("A1").Value = fd_path 'B1セルから下にファイル名を書き出し i = 1 Do Until fl_name = "" Cells(i, "B").Value = fl_name i = i + 1 '次のファイル名を取得 fl_name = Dir Loop End Sub < 使用 Excel:Excel2010、使用 OS:Windows7 > ---- こんな話でしょうか。 http://www.239-programing.com/excel-vba/func/func014_2.html (Mook) 2014/11/25(火) 17:13 ---- ファルダ内のファイル名を確認して、フォルダ選択したいのです。 フォルダを開いて、その開いているフォルダパス、フォルダ内のファイル名を取得するイメージです。 (まあちゃ) 2014/11/25(火) 18:17 ---- Sub main() MsgBox get_folder_path("フォルダ選択", &H4000) End Sub Function get_folder_path(Optional ByVal mes As String = "", _ Optional ByVal opt As Variant = 0, _ Optional ByVal 初期値 = 17) As Variant Dim fld As Object On Error Resume Next get_folder_path = False Do While get_folder_path = False Err.Clear Set fld = CreateObject("Shell.Application").BrowseForFolder(0, mes, opt, 初期値) If Err.Number = 0 Then If Not fld Is Nothing Then If fld.items.Item.isfolder Then get_folder_path = fld.items.Item.Path End If Else Exit Do End If End If Loop Set fld = Nothing On Error GoTo 0 End Function ファイル名を選択すると、再選択させることにしました。 選択可能なのは、あくまでもフォルダーです (ichinose) 2014/11/25(火) 21:58 ...
https://www.excel.studio-kazu.jp/wiki/kazuwiki/201411/20141125151837.txt - [detail] - similar
PREV NEXT
Powered by Hyper Estraier 1.4.13, with 97054 documents and 608268 words.

訪問者:カウンタValid HTML 4.01 Transitional