
{"id":9317,"date":"2025-04-25T18:55:52","date_gmt":"2025-04-25T09:55:52","guid":{"rendered":"https:\/\/techmania.jp\/blog\/?p=9317"},"modified":"2025-04-25T18:55:53","modified_gmt":"2025-04-25T09:55:53","slug":"excel-vba-open","status":"publish","type":"post","link":"https:\/\/techmania.jp\/blog\/excel-vba-open\/","title":{"rendered":"\u3010VBA\u5165\u9580\u3011Open\u30e1\u30bd\u30c3\u30c9\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\uff01\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3084CSV\u306a\u3069\u3092\u8aad\u307f\u8fbc\u3080"},"content":{"rendered":"\n<p>VBA\u3092\u4f7f\u3046\u969b\u306b\u3001 \u300c\u64cd\u4f5c\u4e2d\u306e\u30d6\u30c3\u30af\u3068\u306f\u5225\u306e\u30d6\u30c3\u30af\u3092\u958b\u304d\u305f\u3044\uff01\u300d \u3068\u3044\u3046\u30b1\u30fc\u30b9\u3084\u3001 \u300c\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306b\u3042\u308b\u30c7\u30fc\u30bf\u3092\u4f7f\u3044\u305f\u3044\uff01\u300d \u3068\u3044\u3046\u30b1\u30fc\u30b9\u304c\u8d77\u3053\u308b\u3053\u3068\u306f\u3088\u304f\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u3093\u306a\u3068\u304d\u3001\u6bce\u56de\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30a8\u30af\u30b9\u30d7\u30ed\u30fc\u30e9\u30fc\u3067\u30d5\u30a9\u30eb\u30c0\u3092\u79fb\u52d5\u3057\u3066\u958b\u3044\u3066\u2026\u3068\u3044\u3046\u3053\u3068\u3092\u3059\u308b\u306e\u306f\u624b\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3002\u305b\u3063\u304b\u304fVBA\u3092\u4f7f\u3063\u3066\u3044\u308b\u3093\u3067\u3059\u304b\u3089\u3001\u305d\u3046\u3044\u3063\u305f\u64cd\u4f5c\u3082\u30de\u30af\u30ed\u306b\u7d44\u307f\u8fbc\u3093\u3067\u81ea\u52d5\u5316\u3067\u304d\u308c\u3070\u52b9\u7387\u7684\u3067\u3059\u3088\u306d\u3002<\/p>\n\n\n\n<p>\u305d\u3053\u3067\u4eca\u56de\u306f\u3001VBA\u3092\u5229\u7528\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u969b\u306b\u4f7f\u7528\u3067\u304d\u308b\u30e1\u30bd\u30c3\u30c9\u3084\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306b\u3064\u3044\u3066\u3001\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\uff01<\/p>\n\n\n\n<p>\u4eca\u56de\u306e\u8a18\u4e8b\u3067\u306f\u3001\u4ee5\u4e0b\u306e\uff13\u3064\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fbOpen\u30e1\u30bd\u30c3\u30c9<br>\u30fbGetOpenFilename\u30e1\u30bd\u30c3\u30c9<br>\u30fbOpen\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/p>\n\n\n\n<p>\u305d\u308c\u305e\u308c\u306e\u7279\u5fb4\u3084\u9055\u3044\u304b\u3089\u3001\u5177\u4f53\u7684\u306a\u4f7f\u7528\u65b9\u6cd5\u306b\u3064\u3044\u3066\u9806\u306b\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\u306e\u3067\u3001\u305c\u3072\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n\n\n\n<h2 id=\"outline__1\" class=\"wp-block-heading\">VBA\u306eOpen\u30e1\u30bd\u30c3\u30c9\u3068\u306f\uff1f<\/h2>\n\n\n\n<p>\u307e\u305a\u521d\u3081\u306b\u3001Open\u30e1\u30bd\u30c3\u30c9\u306e\u7279\u5fb4\u304b\u3089\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>Open\u30e1\u30bd\u30c3\u30c9\u3068\u306f\u3001Excel\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u3068\u3057\u3066\u958b\u304b\u308c\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u8868\u3059\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<br>Workbook\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u6301\u3064\u30e1\u30bd\u30c3\u30c9\u306e\u5185\u306e\uff11\u3064\u3067\u3001\u65e2\u5b58\u306e\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u3084\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u305f\u3044\u5834\u5408\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u540c\u3058 \u300cOpen\u300d \u3068\u3044\u3046\u540d\u524d\u3067\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3082\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u304c\u3001Open\u30e1\u30bd\u30c3\u30c9\u306fWorkbook\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5bfe\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u3042\u308b\u305f\u3081\u5e38\u306b\u30d5\u30a1\u30a4\u30eb\u304cExcel\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u3068\u3057\u3066\u958b\u304b\u308c\u308b\u306e\u306b\u5bfe\u3057\u3001Open\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306f\u5358\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u3001\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u8aad\u307f\u66f8\u304d\u306e\u64cd\u4f5c\u3092\u6709\u52b9\u306b\u3059\u308b\u305f\u3081\u306e\u547d\u4ee4\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u306e\u307f\u306b\u9650\u3089\u305atxt\u5f62\u5f0f\u306e\u5e73\u6587\u3084CSV\u306a\u3069\u306e\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001Open\u30e1\u30bd\u30c3\u30c9\u3067\u306f\u5143\u306e\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\u3092\u554f\u308f\u305a\u5168\u3066 Excel\u30d6\u30c3\u30af\u3068\u3057\u3066\u958b\u304b\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h2 id=\"outline__2\" class=\"wp-block-heading\">Excel\u30d6\u30c3\u30af\u3092\u958b\u304f\u306b\u306f\uff1f<\/h2>\n\n\n\n<p>Open\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066Excel\u30d6\u30c3\u30af\u3092\u958b\u304f\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010\u57fa\u672c\u69cb\u6587\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>\/\/ \u5909\u6570\u306b\u683c\u7d0d\u3057\u306a\u3044\u5834\u5408\nWorkbooks.Open &quot;\u30d5\u30a1\u30a4\u30eb\u540d&quot;\n\n\/\/ \u683c\u7d0d\u3059\u308b\u5834\u5408\nDim wb As Workbook\nSet wb = Workbooks.Open(&quot;\u30d5\u30a1\u30a4\u30eb\u540d&quot;)<\/code><\/pre><\/div>\n\n\n\n<p>Open\u30e1\u30bd\u30c3\u30c9\u306f\u6570\u591a\u304f\u306e\u5f15\u6570\u3092\u53d6\u308a\u307e\u3059\u304c\u3001\u5fc5\u9808\u306e\u9805\u76ee\u306f\u4e0a\u8a18\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u307f\u3067\u3059\u3002<br>\u6307\u5b9a\u3067\u304d\u308b\u5f15\u6570\u306e\u5168\u3066\u306e\u7a2e\u985e\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010Open\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u4e00\u89a7\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Workbooks.Open(FileName, UpdateLinks, ReadOnly, Format, Password, WriteResPassword, IgnoreReadOnlyRecommended, Origin, Delimiter, Editable, Notify, Converter, AddToMru, Local, CorruptLoad)<\/code><\/pre><\/div>\n\n\n\n<p>\u9805\u76ee\u304c\u304b\u306a\u308a\u591a\u3044\u305f\u3081\u3001\u57fa\u672c\u7684\u306b\u306f\u3088\u304f\u4f7f\u7528\u3055\u308c\u308b\u5f15\u6570\u3060\u3051\u899a\u3048\u3066\u304a\u3051\u3070\u554f\u984c\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br>\u4ee3\u8868\u7684\u306a\u3082\u306e\u3092\u4ee5\u4e0b\u306e\u4e00\u89a7\u306b\u307e\u3068\u3081\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<style>\n    table.referrence {\n        border: 2px solid rgb(140 140 140);\n        border-collapse: collapse;\n        table-layout: auto;\n        width: 100%\n    }\n\n    th {\n        background-color: #B8CCE4 !important;\n        color: #000 !important;\n        text-align: center !important;\n    }\n\n    th,\n    td {\n        border: 1px solid rgb(160 160 160) !important;\n        padding: 1%;\n        background: #FFF\n    }\n\n    td:nth-last-child(n+2) {\n        text-align: center;\n    }\n<\/style>\n<table class=\"referrence\">\n  <thead>\n    <tr>\n      <th>\u5f15\u6570<\/th>\n      <th>\u8aac\u660e<\/th>\n    <\/tr>\n  <\/thead>\n  <tbody>\n    <tr>\n      <td>FileName<\/td>\n      <td>\u958b\u304d\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u6307\u5b9a<\/td>\n    <\/tr>\n    <tr>\n      <td>ReadOnly<\/td>\n      <td>\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3067\u958b\u304f\u304b\u3092\u6307\u5b9a\uff08True\u306e\u5834\u5408\u306f\u8aad\u307f\u53d6\u308a\u5c02\u7528\uff09<\/td>\n    <\/tr>\n    <tr>\n      <td>Password<\/td>\n      <td>\u30d1\u30b9\u30ef\u30fc\u30c9\u4fdd\u8b77\u4ed8\u304d\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u305f\u3081\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u6307\u5b9a<\/td>\n    <\/tr>\n    <tr>\n      <td>WriteResPassword<\/td>\n      <td>\u66f8\u304d\u8fbc\u307f\u4fdd\u8b77\u4ed8\u304d\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u3080\u305f\u3081\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u6307\u5b9a<\/td>\n    <\/tr>\n    <tr>\n      <td>IgnoreReadOnlyRecommended<\/td>\n      <td>\u8aad\u307f\u53d6\u308a\u5c02\u7528\u63a8\u5968\u30d5\u30a1\u30a4\u30eb\u3092\u66f8\u304d\u8fbc\u307f\u6a29\u9650\u3067\u958b\u304f\u969b\u306b\u3001\u8b66\u544a\u3092\u7121\u8996\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u6307\u5b9a\uff08True\u3067\u975e\u8868\u793a\uff09<\/td>\n    <\/tr>\n    <tr>\n      <td>CorruptLoad<\/td>\n      <td>\u30d5\u30a1\u30a4\u30eb\u304c\u7834\u640d\u3057\u3066\u3044\u308b\u5834\u5408\u306e\u8aad\u307f\u53d6\u308a\u65b9\u6cd5\u3092\u6307\u5b9a<\/td>\n    <\/tr>\n  <\/tbody>\n<\/table>\n\n\n\n<p>\u305d\u306e\u4ed6\u306e\u5f15\u6570\u3084\u3001\u3088\u308a\u8a73\u3057\u3044\u8aac\u660e\u306b\u3064\u3044\u3066\u306f\u3001\u516c\u5f0f\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306e <a href=\"https:\/\/learn.microsoft.com\/ja-jp\/office\/vba\/api\/excel.workbooks.open\">Workbooks.Open \u30e1\u30bd\u30c3\u30c9 (Excel)<\/a> \u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h3 id=\"outline__2_1\" class=\"wp-block-heading\">\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u3066\u958b\u304f<\/h3>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u3001\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u5143\u306b\u4f7f\u3044\u65b9\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>Open\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u969b\u306b\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30d1\u30b9\u3092\u7701\u7565\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u307f\u8a18\u8ff0\u3059\u308b\u3068\u3001\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u304b\u3089\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\u3057\u3088\u3046\u3068\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Workbooks.Open &quot;SampleBook.xlsx&quot;<\/code><\/pre><\/div>\n\n\n\n<p>\u30b1\u30fc\u30b9\u306b\u3088\u3063\u3066\u306f\u610f\u56f3\u305b\u305a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u304f\u306a\u3063\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u306f\u5fc5\u305a\u30d5\u30eb\u30d1\u30b9\u3067\u6307\u5b9a\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p><strong>\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\uff08\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u30d5\u30eb\u30d1\u30b9\u3067\u6307\u5b9a\uff09\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Workbooks.Open &quot;C:\\Users\\User\\Desktop\\SampleBook.xlsx&quot;<\/code><\/pre><\/div>\n\n\n\n<p>\u30de\u30af\u30ed\u304c\u8a18\u8ff0\u3055\u308c\u3066\u3044\u308b\u30d6\u30c3\u30af\u3068\u540c\u4e00\u30d5\u30a9\u30eb\u30c0\u3067\u3042\u308c\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u66f8\u304d\u65b9\u3067\u3082\u53d6\u5f97\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Workbooks.Open Thisworkbook.Path & &quot;\\SampleBook.xlsx&quot;<\/code><\/pre><\/div>\n\n\n\n<h3 id=\"outline__2_2\" class=\"wp-block-heading\">\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f<\/h3>\n\n\n\n<p>\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3067\u30d6\u30c3\u30af\u3092\u958b\u304d\u305f\u3044\u5834\u5408\u306b\u306f\u3001\u5f15\u6570\u306e \u300c<strong>ReadOnly<\/strong>\u300d \u3092True\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Workbooks.Open Filename:=Thisworkbook.Path & &quot;\\SampleBook.xlsx&quot;, ReadOnly:=True <\/code><\/pre><\/div>\n\n\n\n<h2 id=\"outline__3\" class=\"wp-block-heading\">Open\u30e1\u30bd\u30c3\u30c9\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u969b\u306e\u6ce8\u610f\u70b9<\/h2>\n\n\n\n<p>\u8907\u6570\u306e\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u3092\u958b\u304d\u305f\u3044\u5834\u5408\u306b\u4fbf\u5229\u306a Open\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u304c\u3001\u4f7f\u7528\u306e\u969b\u306b\u306f\u6b21\u306e\u70b9\u306b\u6ce8\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6307\u5b9a\u3057\u305f\u30d6\u30c3\u30af\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408<\/li>\n\n\n\n<li>\u6307\u5b9a\u306e\u30d6\u30c3\u30af\u304c\u3059\u3067\u306b\u958b\u304b\u308c\u3066\u3044\u308b\u5834\u5408<\/li>\n<\/ul>\n\n\n\n<p>\u305d\u308c\u305e\u308c\u306e\u5834\u5408\u306b\u3064\u3044\u3066\u3001\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 id=\"outline__3_1\" class=\"wp-block-heading\">\u958b\u3053\u3046\u3068\u3057\u3066\u3044\u308b\u30d6\u30c3\u30af\uff08\u30d5\u30a1\u30a4\u30eb\uff09\u304c\u5b58\u5728\u3057\u306a\u3044<\/h3>\n\n\n\n<p>\u30d1\u30b9\u3084\u30d5\u30a1\u30a4\u30eb\u540d\u304c\u9593\u9055\u3063\u3066\u3044\u308b\u3001\u3042\u308b\u3044\u306f\u65e2\u306b\u524a\u9664\u3055\u308c\u3066\u3044\u308b\u306a\u3069\u306e\u7406\u7531\u3067\u3001\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u304c\u5b58\u5728\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/rensa\/images\/techmania\/thumbnail\/images\/vba_open1.png\" class=\"post-img\">\n\n\n\n<p>\u30d6\u30c3\u30af\u3092\u958b\u304f\u969b\u306b\u306f\u3001\u4e8b\u524d\u306b\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3059\u308b\u304b\u3069\u3046\u304b\u306e\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u3068\u826f\u3044\u3067\u3057\u3087\u3046\u3002<br>\u30d5\u30a1\u30a4\u30eb\u30c1\u30a7\u30c3\u30af\u306b\u306f\u3001Dir\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Sub sampleOpen1()\n\n    If dir( Thisworkbook.Path & &quot;\u00a5SampleBook.xlsx&quot; ) &lt;&gt; &quot;&quot; Then\n        Workbooks.Open Thisworkbook.Path & &quot;\u00a5SampleBook.xlsx&quot;\n    Else\n        MsgBox &quot;SampleBook.xlsx \u304c\u5b58\u5728\u3057\u307e\u305b\u3093&quot;\n    End If\n\nEnd Sub<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u3010\u5b9f\u884c\u7d50\u679c\u3011<\/strong><\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/rensa\/images\/techmania\/thumbnail\/images\/vba_open2.png\" class=\"post-img\">\n\n\n\n<p>Dir\u95a2\u6570\u3067\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u5834\u5408\u306b\u7a7a\u6587\u5b57\u3092\u8fd4\u5374\u3059\u308b\u305f\u3081\u3001\u623b\u308a\u5024\u3092\u57fa\u6e96\u306b\u6761\u4ef6\u5206\u3051\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 id=\"outline__3_2\" class=\"wp-block-heading\">\u958b\u3053\u3046\u3068\u3057\u3066\u3044\u308b\u30d6\u30c3\u30af\uff08\u30d5\u30a1\u30a4\u30eb\uff09\u3092\u65e2\u306b\u958b\u3044\u3066\u3044\u308b<\/h3>\n\n\n\n<p>Excel\u3067\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u4fdd\u5b58\u5834\u6240\u306b\u95a2\u308f\u3089\u305a \u300c\u540c\u540d\u306eExcel\u30d6\u30c3\u30af\u304c\u958b\u3051\u306a\u3044\u300d \u3068\u3044\u3046\u5236\u7d04\u304c\u5b58\u5728\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u306b\u3042\u308b \u300cSampleBook.xlsx\u300d \u3068\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d5\u30a9\u30eb\u30c0\u306b\u3042\u308b \u300cSampleBook.xlsx\u300d \u3092\u540c\u6642\u306b\u958b\u3053\u3046\u3068\u3057\u3066\u3082\u3001\u5148\u306b\u8a18\u8ff0\u3055\u308c\u3066\u3044\u308b\u65b9\u306e\u30d6\u30c3\u30af\u306e\u307f\u3057\u304b\u958b\u304b\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p><strong>\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Sub sampleOpen2()\n\n\u3000Workbooks.Open &quot;C:\\Users\\User\\Desktop\\SampleBook.xlsx&quot;\n\u3000Workbooks.Open &quot;C:\\Users\\User\\Documents\\SampleBook.xlsx&quot;\n\nEnd Sub<\/code><\/pre><\/div>\n\n\n\n<p>\u30d6\u30c3\u30af\u3092\u958b\u304f\u969b\u306b\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u5b58\u5728\u78ba\u8a8d\u3068\u5408\u308f\u305b\u3066\u3001\u540c\u540d\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u65e2\u306b\u958b\u304b\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u3068\u826f\u3044\u3067\u3057\u3087\u3046\u3002<br>Workbooks \u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u73fe\u5728\u958b\u304b\u308c\u3066\u3044\u308b\u5168\u3066\u306e\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Sub sampleOpen3()\n\n    If Dir( Thisworkbook.Path & &quot;\u00a5SampleBook.xlsx&quot; ) &lt;&gt; &quot;&quot; Then\n\n        For Each wb In Workbooks\n            If wb.Name = &quot;SampleBook.xlsx&quot; Then\n                MsgBox &quot;\u3059\u3067\u306b\u540c\u540d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u3044\u307e\u3059&quot;\n                Exit Sub\n            End If\n        Next wb\n        \n        Workbooks.Open ( Thisworkbook.Path & &quot;\u00a5SampleBook.xlsx&quot; )\n\n    Else\n        MsgBox &quot;\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u307e\u305b\u3093&quot;\n    End If\n\nEnd Sub<\/code><\/pre><\/div>\n\n\n\n<h2 id=\"outline__4\" class=\"wp-block-heading\">\u30c0\u30a4\u30a2\u30ed\u30b0\u3067\u30d5\u30a9\u30eb\u30c0\u3092\u6307\u5b9a\u3057\u3066\u958b\u304f<\/h2>\n\n\n\n<p>\u30b1\u30fc\u30b9\u306b\u3088\u3063\u3066\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u306b\u3069\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u304b\u3092\u9078\u629e\u3057\u3066\u3082\u3089\u308f\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u6642\u3082\u3042\u308a\u307e\u3059\u3002<br>Application\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e <strong>GetOpenFilename<\/strong>\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u304b\u3089\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>GetOpenFilename\u30e1\u30bd\u30c3\u30c9\u306e\u69cb\u6587\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010\u57fa\u672c\u69cb\u6587\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Application.GetOpenFilename(FileFilter, FilterIndex, Title, ButtonText, MultiSelect)<\/code><\/pre><\/div>\n\n\n\n<p>\u5f15\u6570\u306f\u5168\u3066\u7701\u7565\u53ef\u80fd\u3067\u3059\u3002<br>\u305d\u308c\u305e\u308c\u306e\u8aac\u660e\u306b\u3064\u3044\u3066\u306f\u3001\u4ee5\u4e0b\u306e\u8868\u306b\u307e\u3068\u3081\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<table class=\"referrence\">\n  <thead>\n    <tr>\n      <th>\u5f15\u6570<\/th>\n      <th>\u8aac\u660e<\/th>\n    <\/tr>\n  <\/thead>\n  <tbody>\n    <tr>\n      <td>FileFilter<\/td>\n      <td>\u30d5\u30a1\u30a4\u30eb\u5019\u88dc\u3092\u6307\u5b9a\u3059\u308b\u6587\u5b57\u5217<\/td>\n    <\/tr>\n    <tr>\n      <td>FilterIndex<\/td>\n      <td>FileFilter\u3067\u6307\u5b9a\u3057\u305f\u6587\u5b57\u5217\u306e\u5185\u3001\u4f55\u756a\u76ee\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3068\u3059\u308b\u304b\u6307\u5b9a<\/td>\n    <\/tr>\n    <tr>\n      <td>Title<\/td>\n      <td>\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u6307\u5b9a<\/td>\n    <\/tr>\n    <tr>\n      <td>ButtonText<\/td>\n      <td>\u30dc\u30bf\u30f3\u306b\u8868\u793a\u3055\u308c\u308b\u30c6\u30ad\u30b9\u30c8\u306e\u6307\u5b9a\uff08Mac\u3067\u306e\u307f\u4f7f\u7528\u53ef\u80fd\uff09<\/td>\n    <\/tr>\n    <tr>\n      <td>MultiSelect<\/td>\n      <td>\u8907\u6570\u9078\u629e\u3092\u53ef\u80fd\u306b\u3059\u308b\u304b\u3092\u6307\u5b9a\uff08True\u3067\u9078\u629e\u53ef\uff09<\/td>\n    <\/tr>\n  <\/tbody>\n<\/table>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u5b9f\u969b\u306e\u52d5\u304d\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p><strong>\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Sub sampleGetOpen1()\n\n    Dim ofn As String\n    ofn = Application.GetOpenFilename(&quot;Excel,*.xlsx&quot;)\n    \n    If ofn &lt;&gt; &quot;False&quot; Then\n        Workbooks.Open (ofn)\n    Else\n        MsgBox &quot;\u30ad\u30e3\u30f3\u30bb\u30eb&quot;\n    End If\n    \nEnd Sub<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u3010\u5b9f\u884c\u7d50\u679c\u3011<\/strong><\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/rensa\/images\/techmania\/thumbnail\/images\/vba_open3.png\" class=\"post-img\">\n\n\n\n<p>FileFilter\u306b\u306f\u3001\u300c\u201d\u8aac\u660e\u6587, \u62e1\u5f35\u5b50\u201d\u300d \u306e\u9806\u3067\u6587\u5b57\u5217\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\u30ad\u30e3\u30f3\u30bb\u30eb\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u308b\u3068False\u304c\u8fd4\u3055\u308c\u308b\u305f\u3081\u3001\u6761\u4ef6\u5206\u3051\u3092\u884c\u3046\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<h3 id=\"outline__4_1\" class=\"wp-block-heading\">\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u3092\u4f7f\u7528\u3059\u308b<\/h3>\n\n\n\n<p>\u62e1\u5f35\u5b50\u306e\u6307\u5b9a\u306b\u306f\u3001\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001Excel\u306e\u62e1\u5f35\u5b50\u306b\u306f\u901a\u5e38\u306e \u300cxlsx\u300d \u3084\u30de\u30af\u30ed\u6709\u52b9\u30d6\u30c3\u30af\u3092\u793a\u3059 \u300cxlsm\u300d\u3001Excel2003\u307e\u3067\u306e\u62e1\u5f35\u5b50\u3067\u3042\u308b \u300cxls\u300d \u306a\u3069\u3044\u304f\u3064\u304b\u306e\u7a2e\u985e\u304c\u3042\u308b\u305f\u3081\u3001\u305d\u308c\u3089\u5168\u3066\u3092\u307e\u3068\u3081\u3066\u6307\u5b9a\u3059\u308b\u5834\u5408\u306b\u306a\u3069\u306b\u6709\u52b9\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p><strong>\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Sub sampleGetOpen2()\n\n    Dim ofn As String\n    ofn = Application.GetOpenFilename(&quot;Excel,*.xls?&quot;)\n    \n    If ofn &lt;&gt; &quot;False&quot; Then\n        Workbooks.Open (ofn)\n    Else\n        MsgBox &quot;\u30ad\u30e3\u30f3\u30bb\u30eb&quot;\n    End If\n\nEnd Sub<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u3010\u5b9f\u884c\u7d50\u679c\u3011<\/strong><\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/rensa\/images\/techmania\/thumbnail\/images\/vba_open4.png\" class=\"post-img\">\n\n\n\n<h3 id=\"outline__4_2\" class=\"wp-block-heading\">\u8907\u6570\u306e\u62e1\u5f35\u5b50\u3092\u5019\u88dc\u3068\u3057\u3066\u958b\u304f<\/h3>\n\n\n\n<p>\uff11\u3064\u306e\u9078\u629e\u80a2\u306b\u5bfe\u3057\u3066\u8907\u6570\u306e\u62e1\u5f35\u5b50\u3092\u5019\u88dc\u3068\u3057\u3066\u767b\u9332\u3057\u305f\u3044\u5834\u5408\u306b\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b \u300c; (\u30bb\u30df\u30b3\u30ed\u30f3)\u300d \u3067\u533a\u5207\u3063\u3066\u8a18\u8ff0\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010\u57fa\u672c\u69cb\u6587\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Application.GetOpenFilename(&quot;\u30d5\u30a1\u30a4\u30eb, *.xlsx ; *.csv&quot;)<\/code><\/pre><\/div>\n\n\n\n<p>\u307e\u305f\u3001\u9078\u629e\u80a2\u3092\u8907\u6570\u8868\u793a\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001 \u8aac\u660e\u6587\u3068\u62e1\u5f35\u5b50\u306e\u30bb\u30c3\u30c8\u3092\u30ab\u30f3\u30de\u3067\u533a\u5207\u3063\u3066\u53cd\u5fa9\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010\u57fa\u672c\u69cb\u6587\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Application.GetOpenFilename(&quot;Excel, *.xlsx, CSV, *.csv&quot;)<\/code><\/pre><\/div>\n\n\n\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p><strong>\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Sub sampleGetOpen3()\n\n    Dim ofn As String\n    ofn = Application.GetOpenFilename(&quot;Excel, *.xlsx ; *.xlsm, CSV, *.csv&quot;)\n    \n    If ofn &lt;&gt; &quot;False&quot; Then\n        Workbooks.Open (ofn)\n    Else\n        MsgBox &quot;\u30ad\u30e3\u30f3\u30bb\u30eb&quot;\n    End If\n\nEnd Sub<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u3010\u5b9f\u884c\u7d50\u679c\u3011<\/strong><\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/rensa\/images\/techmania\/thumbnail\/images\/vba_open5.png\" class=\"post-img\">\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u8907\u6570\u306e\u62e1\u5f35\u5b50\u3084\u9078\u629e\u80a2\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Sub sampleGetOpen4()\n\n    Dim ofn As String\n    ofn = Application.GetOpenFilename(FileFilter:=&quot;Excel, *.xls?&quot;, MultiSelect:=True)\n    \n    If ofn &lt;&gt; &quot;False&quot; Then\n        Workbooks.Open (ofn)\n    Else\n        MsgBox &quot;\u30ad\u30e3\u30f3\u30bb\u30eb&quot;\n    End If\nEnd Sub<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u3010\u5b9f\u884c\u7d50\u679c\u3011<\/strong><\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/rensa\/images\/techmania\/thumbnail\/images\/vba_open6.png\" class=\"post-img\">\n\n\n\n<h3 id=\"outline__4_3\" class=\"wp-block-heading\">\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e\u3057\u3066\u958b\u304f<\/h3>\n\n\n\n<p>\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u540c\u6642\u306b\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u5f15\u6570\u306e MultiSelect\u3092 True\u3067\u6307\u5b9a\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p><strong>\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Sub sampleGetOpen4()\n\n    Dim ofn As String\n    ofn = Application.GetOpenFilename(FileFilter:=&quot;Excel, *.xls?&quot;, MultiSelect:=True)\n    \n    If ofn &lt;&gt; &quot;False&quot; Then\n        Workbooks.Open (ofn)\n    Else\n        MsgBox &quot;\u30ad\u30e3\u30f3\u30bb\u30eb&quot;\n    End If\n\nEnd Sub<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u3010\u5b9f\u884c\u7d50\u679c\u3011<\/strong><\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/rensa\/images\/techmania\/thumbnail\/images\/vba_open7.png\" class=\"post-img\">\n\n\n\n<h2 id=\"outline__5\" class=\"wp-block-heading\">Excel\u30d6\u30c3\u30af\u4ee5\u5916\u306e\u30d5\u30a1\u30a4\u30eb\uff08\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3001CSV\uff09\u3092\u958b\u304f<\/h2>\n\n\n\n<p>\u7d9a\u3044\u3066\u3001\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3084CSV\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u65b9\u6cd5\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002<br>\u5148\u307b\u3069\u89e3\u8aac\u3057\u305f Open\u30e1\u30bd\u30c3\u30c9\u3067\u3082\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3053\u3068\u306f\u53ef\u80fd\u3067\u3059\u304c\u3001\u305d\u306e\u4ed6\u306e\u65b9\u6cd5\u3068\u3057\u3066 Open\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u8a73\u3057\u3044\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 id=\"outline__5_1\" class=\"wp-block-heading\">Open\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f<\/h3>\n\n\n\n<p>\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u969b\u306b\u3088\u304f\u4f7f\u7528\u3055\u308c\u308b\u306e\u304c\u3001Open\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u3059\u3002<br>\u57fa\u672c\u69cb\u6587\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010\u57fa\u672c\u69cb\u6587\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Open \u201c\u30d5\u30a1\u30a4\u30eb\u540d\u201d For \u30a2\u30af\u30bb\u30b9\u30e2\u30fc\u30c9 As #\u30d5\u30a1\u30a4\u30eb\u756a\u53f7<\/code><\/pre><\/div>\n\n\n\n<p>\u5fc5\u9808\u306e\u5f15\u6570\u306f\u3001\u4e0a\u8a18\u306e \u300c\u30d5\u30a1\u30a4\u30eb\u540d(pathname)\u300d\u3001 \u300c\u30a2\u30af\u30bb\u30b9\u30e2\u30fc\u30c9(mode)\u300d\u3001 \u300c\u30d5\u30a1\u30a4\u30eb\u756a\u53f7(filenumber)\u300d\u306e\uff13\u3064\u3067\u3059\u3002<br>\u305d\u306e\u4ed6\u306b\u3082\u3001\u4efb\u610f\u3067\u6307\u5b9a\u3067\u304d\u308b\u5f15\u6570\u3092\u5168\u3066\u542b\u3081\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306a\u5f62\u5f0f\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Open pathname For mode [access] [lock] As [#]filenumber [Len=reclength]<\/code><\/pre><\/div>\n\n\n\n<p>\u30d5\u30a1\u30a4\u30eb\u540d\u4ee5\u5916\u306e\u5404\u5f15\u6570\u306b\u3064\u3044\u3066\u306f\u3001\u4ee5\u4e0b\u306b\u8aac\u660e\u3092\u307e\u3068\u3081\u305f\u306e\u3067\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p><strong>\u3010mode\u3011<\/strong><br>\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u969b\u306e\u30a2\u30af\u30bb\u30b9\u30e2\u30fc\u30c9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u65e2\u5b9a\u306f Random\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30fbRandom<br>\u30e9\u30f3\u30c0\u30e0\u30a2\u30af\u30bb\u30b9\u30e2\u30fc\u30c9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\u56fa\u5b9a\u9577\u30c7\u30fc\u30bf\u30d5\u30a1\u30a4\u30eb\u3092\u5165\u51fa\u529b\u3057\u305f\u3044\u5834\u5408\u306b\u4f7f\u7528\u3057\u3001Get \u3068 Put \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u3063\u3066\u8aad\u307f\u66f8\u304d\u8fbc\u307f\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fbInput<br>\u30b7\u30fc\u30b1\u30f3\u30b7\u30e3\u30eb\u5165\u529b\u30e2\u30fc\u30c9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>Line Input \u3068 Input \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3001\u5148\u982d\u304b\u3089\u9806\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fbOutput<br>\u30b7\u30fc\u30b1\u30f3\u30b7\u30e3\u30eb\u51fa\u529b\u30e2\u30fc\u30c9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>Write \u3068 Print \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3001\u5148\u982d\u304b\u3089\u9806\u306b\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fbAppend<br>\u540c\u3058\u304f\u30b7\u30fc\u30b1\u30f3\u30b7\u30e3\u30eb\u51fa\u529b\u30e2\u30fc\u30c9\u3092\u6307\u5b9a\u3057\u307e\u3059\u304c\u3001Output\u304c\u4e0a\u66f8\u304d\u5f62\u5f0f\u306a\u306e\u306b\u5bfe\u3057\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u7d42\u7aef\u306b\u5185\u5bb9\u3092\u66f8\u304d\u8fbc\u3080\u8ffd\u52a0\u5f62\u5f0f\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fbBinary<br>\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u30e2\u30fc\u30c9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u3092\u5165\u51fa\u529b\u3057\u305f\u3044\u5834\u5408\u306b\u4f7f\u7528\u3057\u3001Get \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3068 Put \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u3063\u3066\u8aad\u307f\u66f8\u304d\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010access\u3011<\/strong><br>\u958b\u3044\u305f\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u3057\u3066\u8a31\u53ef\u3059\u308b\u64cd\u4f5c\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\u6307\u5b9a\u306e\u30a2\u30af\u30bb\u30b9\u30e2\u30fc\u30c9\u306e\u51e6\u7406\u3068\u77db\u76fe\u3059\u308b access\u30bf\u30a4\u30d7\u3092\u9078\u3076\u3068\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fbRead<br>Input \u30e2\u30fc\u30c9\u306e\u65e2\u5b9a\u30bf\u30a4\u30d7\u3002\u8aad\u307f\u8fbc\u307f\u5c02\u7528\u3067\u958b\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fbWrite<br>Output\u3001Append\u3001Binary \u30e2\u30fc\u30c9\u306e\u65e2\u5b9a\u30bf\u30a4\u30d7\u3002\u66f8\u304d\u8fbc\u307f\u5c02\u7528\u3067\u958b\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fbRead Write<br>Random \u30e2\u30fc\u30c9\u306e\u65e2\u5b9a\u30bf\u30a4\u30d7\u3002\u8aad\u307f\u66f8\u304d\u53ef\u80fd\u3067\u958b\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010lock\u3011<\/strong><br>\u5225\u30d7\u30ed\u30bb\u30b9\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3055\u308c\u305f\u5834\u5408\u306b\u3001\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u3069\u306e\u3088\u3046\u306b\u5171\u6709\u3059\u308b\u304b\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\u65e2\u5b9a\u306f Shared \u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30fbShared<br>\u30d5\u30a1\u30a4\u30eb\u306f\u30ed\u30c3\u30af\u3055\u308c\u305a\u3001\u5225\u30d7\u30ed\u30bb\u30b9\u304b\u3089\u3082\u8aad\u307f\u66f8\u304d\u8fbc\u307f\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30fbLock Read<br>\u5225\u30d7\u30ed\u30bb\u30b9\u304b\u3089\u306e\u8aad\u307f\u8fbc\u307f\u3092\u7981\u6b62\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fbLock Read Write<br>\u5225\u30d7\u30ed\u30bb\u30b9\u304b\u3089\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u66f8\u304d\u3092\u7981\u6b62\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fbLock Write<br>\u5225\u30d7\u30ed\u30bb\u30b9\u304b\u3089\u306e\u66f8\u304d\u8fbc\u307f\u3092\u7981\u6b62\u3057\u307e\u3059\u3002\uff08\u65e2\u306b Write\u30a2\u30af\u30bb\u30b9\u3067\u958b\u304b\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306e\u307f\uff09<\/p>\n\n\n\n<p><strong>\u3010filenumber\u3011<\/strong><br>OS\u4e0a\u306e\u30d5\u30a1\u30a4\u30eb\u7ba1\u7406\u306b\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u756a\u53f7\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\u756a\u53f7\u306e\u91cd\u8907\u306f\u4e0d\u53ef\u306e\u305f\u3081\u3001FreeFile\u95a2\u6570\u3067\u4f7f\u7528\u53ef\u80fd\u306a\u30d5\u30a1\u30a4\u30eb\u756a\u53f7\u3092\u53d6\u5f97\u3059\u308b\u3068\u3088\u308a\u5b89\u5168\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010reclength\u3011<\/strong><br>Random\u30e2\u30fc\u30c9\u3067\u958b\u3044\u305f\u5834\u5408\u306b\u3001\u3053\u306e\u5f15\u6570\u3067\u6307\u5b9a\u3057\u305f\u6570\u5024\u304c\u30d5\u30a1\u30a4\u30eb\u306e\u30ec\u30b3\u30fc\u30c9\u9577\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 id=\"outline__5_2\" class=\"wp-block-heading\">\u30c6\u30ad\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3080<\/h3>\n\n\n\n<p>\u30c6\u30ad\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3080\u5834\u5408\u306f\u3001Line Input# \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>Line Input#\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306f\u3001\u6307\u5b9a\u306e\u30d5\u30a1\u30a4\u30eb\u30921\u884c\u305a\u3064\u8aad\u307f\u53d6\u308a\u3001\u305d\u306e\u5185\u5bb9\u3092String\u578b\u5909\u6570\u306b\u683c\u7d0d\u3059\u308b\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u3059\u3002<br>\u4f7f\u7528\u3059\u308b\u969b\u306e\u69cb\u6587\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010\u57fa\u672c\u69cb\u6587\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Line Input #\u30d5\u30a1\u30a4\u30eb\u756a\u53f7, \u5909\u6570\u540d<\/code><\/pre><\/div>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u4f7f\u3044\u65b9\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p><strong>\u3010\u4f7f\u7528\u3059\u308b\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code># sample.text\n\nHello\nWorld!<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Sub sampleLineInput()\n\n    Dim str As String\n\n    If dir(ThisWorkbook.path + &quot;\\sample.txt&quot;) = &quot;&quot; Then\n        MsgBox &quot;\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u307e\u305b\u3093&quot;\n        Exit Sub\n    End If\n    \n    Open ThisWorkbook.path + &quot;\\sample.txt&quot; For Input As #1\n    \n        Do While Not EOF(1)\n    \n            Line Input #1, txt\n            str = str + txt + vbCrLf\n        Loop\n        \n        MsgBox str\n\n    Close #1\n\nEnd Sub<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u3010\u5b9f\u884c\u7d50\u679c\u3011<\/strong><\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/rensa\/images\/techmania\/thumbnail\/images\/vba_open7.png\" class=\"post-img\">\n\n\n\n<h2 id=\"outline__6\" class=\"wp-block-heading\">CSV\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3080<\/h2>\n\n\n\n<p>CSV\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3080\u5834\u5408\u306f\u3001Input#\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u7528\u3059\u308b\u3068\u4fbf\u5229\u3067\u3059\u3002<\/p>\n\n\n\n<p>Input# \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u306f\u3001 \u300c,\uff08\u30ab\u30f3\u30de\uff09\u300d \u3084\u6539\u884c\u3067\u30c7\u30fc\u30bf\u304c\u533a\u5207\u3089\u308c\u3001\u5f15\u6570\u306b\u6307\u5b9a\u3057\u305f\u5909\u6570\u306b\u4ee3\u5165\u3055\u308c\u307e\u3059\u3002<br>\u4f7f\u7528\u3059\u308b\u969b\u306e\u69cb\u6587\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010\u57fa\u672c\u69cb\u6587\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Input # filenumber, var1, var2, \u30fb\u30fb\u30fb<\/code><\/pre><\/div>\n\n\n\n<p>\u5909\u6570\u306f\u8907\u6570\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<br>\u4ee5\u4e0b\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u5b9f\u969b\u306e\u52d5\u304d\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p><strong>\u3010CSV\u30d5\u30a1\u30a4\u30eb\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code># sample.csv\n\nID,\u5546\u54c1\n&quot;001&quot;,\u308a\u3093\u3054\n&quot;002&quot;,\u307f\u304b\u3093<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Sub sampleInput1()\n\n    Dim str As String\n\n    If dir(ThisWorkbook.path + &quot;\\sample.csv&quot;) = &quot;&quot; Then\n        MsgBox &quot;\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u307e\u305b\u3093&quot;\n        Exit Sub\n    End If\n    \n    Open ThisWorkbook.path + &quot;\\sample.csv&quot; For Input As #1\n    \n        Do While Not EOF(1)\n    \n            Input #1, txt1, txt2\n            str = str + txt1 + &quot;\u3000&quot; + txt2 + vbCrLf\n        Loop\n        \n        MsgBox str\n\n    Close #1\n\nEnd Sub<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u3010\u5b9f\u884c\u7d50\u679c\u3011<\/strong><\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/rensa\/images\/techmania\/thumbnail\/images\/vba_open8.png\" class=\"post-img\">\n\n\n\n<p>\u4e0a\u8a18\u306e\u4f8b\u3067\u306f\u30c0\u30a4\u30a2\u30ed\u30b0\u8868\u793a\u3059\u308b\u306e\u307f\u306a\u306e\u3067\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u304c\u3001 \u6587\u5b57\u5217\u3068\u3057\u3066\u51e6\u7406\u3057\u3066\u3044\u308b \u300c001\u300d \u3084 \u300c002\u300d \u3068\u3044\u3063\u305f\u6570\u5024\u3092\u305d\u306e\u307e\u307e\u30bb\u30eb\u306b\u4ee3\u5165\u3057\u3066\u3057\u307e\u3046\u3068\u3001Excel\u306e\u4ed5\u69d8\u306b\u3088\u308a \u300c1\u300d \u3084 \u300c2\u300d \u3068\u3044\u3063\u305f\u6570\u5024\u306b\u81ea\u52d5\u3067\u5909\u63db\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u307e\u307e\u6587\u5b57\u5217\u3068\u3057\u3066\u4ee3\u5165\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30bb\u30eb\u306e\u66f8\u5f0f\u3092 NumberFormat\u3067\u5909\u66f4\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u30fbCSV<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code># sample.csv\n\n&quot;001&quot;,&quot;002&quot;,&quot;003&quot;<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Sub sampleInput2()\n\n    Dim str As String\n\n    If dir(ThisWorkbook.path + &quot;\\sample.csv&quot;) = &quot;&quot; Then\n        MsgBox &quot;\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u307e\u305b\u3093&quot;\n        Exit Sub\n    End If\n    \n    Open ThisWorkbook.path + &quot;\\sample.csv&quot; For Input As #1\n    \n        Do While Not EOF(1)\n    \n            Input #1, txt1, txt2, txt3\n            \n            Cells(1, 1).NumberFormat = &quot;@&quot;\n            Cells(1, 1).Value = txt1\n            Cells(1, 2).NumberFormat = &quot;@&quot;\n            Cells(1, 2).Value = txt2\n            Cells(1, 3).NumberFormat = &quot;@&quot;\n            Cells(1, 3).Value = txt3\n\n        Loop\n        \n    Close #1\n\nEnd Sub<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u3010\u5b9f\u884c\u7d50\u679c\u3011<\/strong><\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/rensa\/images\/techmania\/thumbnail\/images\/vba_open9.png\" class=\"post-img\">\n\n\n\n<h3 id=\"outline__6_1\" class=\"wp-block-heading\">\u958b\u3044\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b<\/h3>\n\n\n\n<p>\u958b\u3044\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u51e6\u7406\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001Close\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u3063\u3066\u5fc5\u305a\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<br>\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b\u3053\u3068\u3067\u3001\u5272\u308a\u632f\u3089\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u756a\u53f7\u304c\u958b\u653e\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010\u57fa\u672c\u69cb\u6587\u3011<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Close \u30d5\u30a1\u30a4\u30eb\u756a\u53f71, \u30d5\u30a1\u30a4\u30eb\u756a\u53f72 ...<\/code><\/pre><\/div>\n\n\n\n<p>\u5f15\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u756a\u53f7\u3092\u7701\u7565\u3059\u308b\u3068\u3001Open\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u958b\u3044\u305f\u5168\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u9589\u3058\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h2 id=\"outline__7\" class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u3044\u304b\u304c\u3067\u3057\u305f\u304b\uff1f<br>\u4eca\u56de\u306f\u3001VBA\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>VBA\u3067\u7d44\u3093\u3060\u30de\u30af\u30ed\u306e\u4e2d\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3051\u308b\u3088\u3046\u306b\u306a\u308c\u3070\u3001\u81ea\u52d5\u5316\u3067\u304d\u308b\u4f5c\u696d\u306e\u5e45\u3082\u5e83\u304c\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u308c\u305e\u308c\u306e\u65b9\u6cd5\u306b\u3001\u4f7f\u7528\u3059\u308b\u30e1\u30ea\u30c3\u30c8\u3084\u9069\u3057\u305f\u30b1\u30fc\u30b9\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u958b\u304d\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\u306a\u3069\u306b\u5408\u308f\u305b\u3066\u4f7f\u3044\u5206\u3051\u3092\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n\n\n\n<h2 id=\"outline__8\" class=\"wp-block-heading\">VBA\u306e\u52c9\u5f37\u65b9\u6cd5\u306f\uff1f<\/h2>\n\n\n<p>\u66f8\u7c4d\u3084\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u3067\u5b66\u7fd2\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002\u6628\u4eca\u3067\u306f\u3001YouTube\u306a\u3069\u306e\u52d5\u753b\u30b5\u30a4\u30c8\u3084\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u30b5\u30a4\u30c8\u306a\u3069\u3082\u5145\u5b9f\u3057\u3066\u3044\u3066\u591a\u304f\u306e\u60c5\u5831\u304c\u624b\u306b\u5165\u308a\u307e\u3059\u3002<br \/>\u305d\u3057\u3066\u3001\u3088\u308a\u52b9\u7387\u7684\u306b\u77e5\u8b58\u30fb\u30b9\u30ad\u30eb\u3092\u7fd2\u5f97\u3059\u308b\u306b\u306f\u3001\u77e5\u8b58\u3092\u3064\u3051\u306a\u304c\u3089\u5b9f\u969b\u306b\u624b\u3092\u52d5\u304b\u3057\u3066\u307f\u308b\u306a\u3069\u3001\u30a4\u30f3\u30d7\u30c3\u30c8\u3068\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u3092\u7e70\u308a\u8fd4\u3057\u3066\u3044\u304f\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\u7279\u306b\u72ec\u5b66\u306e\u5834\u5408\u306f\u3001\u6709\u8b58\u8005\u306b\u8cea\u554f\u304c\u3067\u304d\u305f\u308a\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u3092\u3082\u3089\u3048\u308b\u3088\u3046\u306a\u74b0\u5883\u304c\u3042\u308b\u3068\u3001\u7406\u89e3\u5ea6\u304c\u6df1\u307e\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u305f\u3060\u3001VBA\u306b\u9650\u3089\u305a\u3001IT\u30b9\u30ad\u30eb\u3092\u8eab\u306b\u3064\u3051\u308b\u969b\u3001\u3069\u3046\u3057\u3066\u3082\u8ab2\u984c\u306b\u3076\u3064\u304b\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u306f\u3042\u308a\u307e\u3059\u3088\u306d\u3002\u7279\u306b\u72ec\u5b66\u3060\u3068\u3001\u308f\u304b\u3089\u306a\u3044\u90e8\u5206\u3092\u30d7\u30ed\u306b\u8cea\u554f\u3067\u304d\u308b\u6a5f\u4f1a\u3092\u78ba\u4fdd\u3057\u306b\u304f\u304f\u3001\u30e2\u30c1\u30d9\u30fc\u30b7\u30e7\u30f3\u304c\u7d9a\u304d\u306b\u304f\u3044\u3068\u3044\u3046\u5074\u9762\u304c\u3042\u308a\u307e\u3059\u3002\u72ec\u5b66\u3067\u30e2\u30c1\u30d9\u30fc\u30b7\u30e7\u30f3\u3092\u7dad\u6301\u3059\u308b\u81ea\u4fe1\u304c\u306a\u3044\u4eba\u306b\u306f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u3068\u3044\u3046\u624b\u3082\u3042\u308a\u307e\u3059\u3002\u8cbb\u7528\u306f\u639b\u304b\u308a\u307e\u3059\u304c\u3001\u305d\u306e\u5206\u30b9\u30ad\u30eb\u3092\u8eab\u306b\u3064\u3051\u3084\u3059\u3044\u3067\u3059\u3002\u3057\u3063\u304b\u308a\u3068\u77e5\u8b58\u30fb\u30b9\u30ad\u30eb\u3092\u7fd2\u5f97\u3057\u3066\u5b9f\u8df5\u306b\u6d3b\u304b\u3057\u305f\u3044\u3068\u3044\u3046\u4eba\u306f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u304c\u304a\u3059\u3059\u3081\u3067\u3059\u3002<\/p>\n<p><span class=\"markerYellow\"><strong>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u306a\u3089\u30c6\u30c3\u30af\u30de\u30cb\u30a2\u304c\u304a\u3059\u3059\u3081\uff01<\/strong><\/span><\/p>\n\n\n<img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/rensa\/images\/techmania\/thumbnail\/images\/yuudou.png\" class=\"post-img\">\n\n\n<p>IT\u30b9\u30ad\u30eb\u9700\u8981\u306e\u9ad8\u307e\u308a\u3068\u3068\u3082\u306b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u3082\u5897\u3048\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u3001\u3069\u306e\u30b9\u30af\u30fc\u30eb\u306b\u901a\u3046\u3079\u304d\u304b\u8ff7\u3063\u3066\u3057\u307e\u3046\u4eba\u3082\u3044\u308b\u3067\u3057\u3087\u3046\u3002\u305d\u3093\u306a\u65b9\u306b\u306f\u30c6\u30c3\u30af\u30de\u30cb\u30a2\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\uff01\u3053\u308c\u307e\u3067\u591a\u304f\u306eIT\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u80b2\u6210\u30fb\u8f29\u51fa\u3057\u3066\u304d\u305f\u30c6\u30c3\u30af\u30de\u30cb\u30a2\u3067\u3082\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u3092\u958b\u8b1b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"bgBox\">\n<p><strong>\uff1c\u30c6\u30c3\u30af\u30de\u30cb\u30a2\u306e\u7279\u5fb4\uff1e<\/strong><br \/><strong>\u30fb\u305f\u3057\u304b\u306a\u80b2\u6210\u5b9f\u7e3e\u3068\u89aa\u8eab\u306a\u6559\u80b2\u3000\uff5e\u30bb\u30ab\u30f3\u30c9\u30ad\u30e3\u30ea\u30a2\u3092\u5168\u529b\u652f\u63f4\uff5e<\/strong><br \/><strong>\u30fb\u8b1b\u5e2b\u304c\u73fe\u5f79\u30a8\u30f3\u30b8\u30cb\u30a2\u3000\uff5e\u201c\u672c\u5f53\u201d\u306e\u958b\u767a\u30ce\u30a6\u30cf\u30a6\u3092\u76f4\u306b\u5b66\u3079\u308b\uff5e<\/strong><br \/><strong>\u30fb\u5c02\u5c5e\u8b1b\u5e2b\u304c\u5b66\u7fd2\u3092\u5fb9\u5e95\u30b5\u30dd\u30fc\u30c8\u3000\uff5e\u300c\u308f\u304b\u3089\u306a\u3044\u300d\u3092\u5fb9\u5e95\u89e3\u6c7a\uff5e<\/strong><br \/><strong>\u30fb\u5b9f\u52d9\u30d9\u30fc\u30b9\u3067\u30b9\u30ad\u30eb\u3092\u7fd2\u5f97\u3000\uff5e\u5b9f\u8df5\u7684\u306a\u51dd\u7e2e\u30ab\u30ea\u30ad\u30e5\u30e9\u30e0\uff5e<\/strong><\/p>\n<\/div>\n<p>\u3053\u306e\u3088\u3046\u306a\u7279\u5fb4\u3092\u6301\u3064\u30c6\u30c3\u30af\u30de\u30cb\u30a2\u306fIT\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30b9\u30bf\u30fc\u30c8\u30e9\u30a4\u30f3\u3068\u3057\u3066\u6700\u9069\u3067\u3059\u3002<br \/>\u8a71\u3092\u805e\u304d\u305f\u3044\u30fb\u8a73\u3057\u304f\u77e5\u308a\u305f\u3044\u3068\u3044\u3046\u65b9\u306f<a href=\"https:\/\/techmania.jp\/lp\/2\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a>\u304b\u3089\u304a\u6c17\u8efd\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002<\/p>","protected":false},"excerpt":{"rendered":"VBA\u3092\u4f7f\u3046\u969b\u306b\u3001 \u300c\u64cd\u4f5c\u4e2d\u306e\u30d6\u30c3\u30af\u3068\u306f\u5225\u306e\u30d6\u30c3\u30af\u3092\u958b\u304d\u305f\u3044\uff01\u300d \u3068\u3044\u3046\u30b1\u30fc\u30b9\u3084\u3001 \u300c\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306b\u3042\u308b\u30c7\u30fc\u30bf\u3092\u4f7f\u3044\u305f\u3044\uff01\u300d \u3068\u3044\u3046\u30b1\u30fc\u30b9\u304c\u8d77\u3053\u308b\u3053\u3068\u306f\u3088\u304f\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002 \u305d\u3093\u306a\u3068\u304d\u3001\u6bce\u56de\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30a8\u30af\u30b9\u30d7\u30ed\u30fc\u30e9\u30fc\u3067\u30d5\u30a9\u30eb\u30c0\u3092\u79fb\u52d5\u3057\u3066\u958b\u3044\u3066\u2026\u3068\u3044\u3046\u3053\u3068\u3092\u3059\u308b\u306e\u306f\u624b\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3002\u305b\u3063\u304b\u304fVBA\u3092\u4f7f\u3063\u3066\u3044\u308b\u3093\u3067\u3059\u304b\u3089\u3001\u305d\u3046\u3044\u3063\u305f\u64cd\u4f5c\u3082\u30de\u30af\u30ed\u306b\u7d44\u307f\u8fbc\u3093\u3067\u81ea\u52d5\u5316\u3067\u304d\u308c\u3070\u52b9\u7387\u7684\u3067\u3059\u3088\u306d\u3002 \u305d\u3053\u3067 [&hellip;]","protected":false},"author":11,"featured_media":9331,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9317","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/posts\/9317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/comments?post=9317"}],"version-history":[{"count":7,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/posts\/9317\/revisions"}],"predecessor-version":[{"id":9330,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/posts\/9317\/revisions\/9330"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/media\/9331"}],"wp:attachment":[{"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/media?parent=9317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/categories?post=9317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/tags?post=9317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}