{"id":607,"date":"2021-05-18T20:14:04","date_gmt":"2021-05-18T11:14:04","guid":{"rendered":"https:\/\/sunafukin.jp\/?p=607"},"modified":"2021-05-20T00:49:53","modified_gmt":"2021-05-19T15:49:53","slug":"%e3%83%95%e3%82%a9%e3%83%ab%e3%83%80%e3%82%92%e9%81%b8%e6%8a%9e%e3%81%99%e3%82%8b%e3%81%9f%e3%82%81%e3%81%ae%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%82%92%e4%bd%9c%e6%88%90%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/sunafukin.jp\/?p=607","title":{"rendered":"VBA:\u30d5\u30a9\u30eb\u30c0\u3092\u9078\u629e\u3059\u308b\u305f\u3081\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u4f5c\u6210\u3059\u308b"},"content":{"rendered":"<h2>FileDialog\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u5229\u7528\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u9078\u629e\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u4f5c\u6210\u3059\u308b<\/h2>\n<p>FileDialog\u3092\u5229\u7528\u3057\u3066\u3001\u521d\u671f\u30d5\u30a9\u30eb\u30c0\u3092\u8a2d\u5b9a\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u9078\u629e\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u95a2\u6570\u306b\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305d\u306e\u307e\u307e\u30b3\u30d4\u30fc\u3057\u3066\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:vb decode:true \">Function \u30d5\u30a9\u30eb\u30c0\u3092\u9078\u629e\u3059\u308b(strFolder As String)\r\n\r\n    If Right(strFolder, 1) &lt;&gt; \"\\\" Then\r\n        strFolder = strFolder &amp; \"\\\"\r\n    End If\r\n    With Application.FileDialog(msoFileDialogFolderPicker)\r\n        .InitialFileName = strFolder    ' \u30d5\u30a9\u30eb\u30c0\u306e\u521d\u671f\u5024\u3092\u8a2d\u5b9a\r\n        .Title = \"\u30d5\u30a9\u30eb\u30c0\u3092\u9078\u629e\"\r\n        If .Show = True Then\r\n            \u30d5\u30a9\u30eb\u30c0\u3092\u9078\u629e\u3059\u308b = .SelectedItems(1)\r\n        End If\r\n    End With\r\n\r\nEnd Function<\/pre>\n<h3>\u95a2\u6570\u306e\u8aac\u660e<\/h3>\n<p>strFolder:\u521d\u671f\u8a2d\u5b9a\u3059\u308b\u30d5\u30a9\u30eb\u30c0\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<h3>\u4f7f\u7528\u4f8b<\/h3>\n<p>C2\u30bb\u30eb\u306b\u30d5\u30a9\u30eb\u30c0\u304c\u5165\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>C2\u30bb\u30eb\u306e\u30d5\u30a9\u30eb\u30c0\u3092\u521d\u671f\u8a2d\u5b9a\u3068\u3057\u3066\u3001\u300c\u30d5\u30a9\u30eb\u30c0\u3092\u9078\u629e\u3059\u308b\u300d\u95a2\u6570\u306b\u6e21\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a9\u30eb\u30c0\u3092\u9078\u629e\u3057\u305f\u5834\u5408\u3001C2\u30bb\u30eb\u306b\u9078\u629e\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u3092\u4ee3\u5165\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:vb decode:true \">Sub \u30d5\u30a9\u30eb\u30c0\u3092\u9078\u629e\u3059\u308b_Click()\r\n\r\n    Dim strFolder As String\r\n    Dim strGetFolder As String\r\n    \r\n    strFolder = Range(\"c2\")\r\n    \r\n    strGetFolder = \u30d5\u30a9\u30eb\u30c0\u3092\u9078\u629e\u3059\u308b(strFolder)\r\n    If strGetFolder &lt;&gt; \"\" Then\r\n        Range(\"c2\") = strGetFolder\r\n    End If\r\n    \r\nEnd Sub<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FileDialog\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u5229\u7528\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u9078\u629e\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u4f5c\u6210\u3059\u308b FileDialog\u3092\u5229\u7528\u3057\u3066\u3001\u521d\u671f\u30d5\u30a9\u30eb\u30c0\u3092\u8a2d\u5b9a\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u9078\u629e\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u95a2\u6570\u306b\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305d\u306e\u307e\u307e\u30b3\u30d4\u30fc\u3057\u3066\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 Function \u30d5\u30a9\u30eb\u30c0\u3092\u9078\u629e\u3059\u308b(strFolder As String) If Right(strFolder, 1) &lt;&gt; &#8220;\\&#8221; Then st [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":599,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[230],"tags":[233,234,113,231,232],"class_list":["post-607","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vba","tag-filedialog","tag-msofiledialogfolderpicker","tag-vba","tag-231","tag-232"],"_links":{"self":[{"href":"https:\/\/sunafukin.jp\/index.php?rest_route=\/wp\/v2\/posts\/607"}],"collection":[{"href":"https:\/\/sunafukin.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sunafukin.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sunafukin.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sunafukin.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=607"}],"version-history":[{"count":4,"href":"https:\/\/sunafukin.jp\/index.php?rest_route=\/wp\/v2\/posts\/607\/revisions"}],"predecessor-version":[{"id":634,"href":"https:\/\/sunafukin.jp\/index.php?rest_route=\/wp\/v2\/posts\/607\/revisions\/634"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sunafukin.jp\/index.php?rest_route=\/wp\/v2\/media\/599"}],"wp:attachment":[{"href":"https:\/\/sunafukin.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sunafukin.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sunafukin.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}