{"id":4923,"date":"2014-09-26T16:38:51","date_gmt":"2014-09-26T07:38:51","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=4923"},"modified":"2014-09-26T16:38:51","modified_gmt":"2014-09-26T07:38:51","slug":"%e9%81%b8%e6%8a%9e%e4%b8%ad%e3%81%ae%e8%a1%a8%e3%81%ae%e8%a1%8c%e6%95%b0%e3%82%92%e5%8f%96%e5%be%97%e3%81%99%e3%82%8bword%e3%83%9e%e3%82%af%e3%83%ad","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=4923","title":{"rendered":"\u9078\u629e\u4e2d\u306e\u8868\u306e\u884c\u6570\u3092\u53d6\u5f97\u3059\u308bWord\u30de\u30af\u30ed"},"content":{"rendered":"<p>\u300c<span style=\"color: #ff0000; font-weight: bold;\">Word VBA \u8868 \u884c\u6570<\/span>\u300d\u3068\u3044\u3063\u305f\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u3067\u306e\u30a2\u30af\u30bb\u30b9\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>Word\u30de\u30af\u30ed\u3067\u8868\u306e\u884c\u6570\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3092\u8abf\u3079\u3066\u3044\u308b\u65b9\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u3060\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u5b9f\u306f\u8868\u306e\u884c\u6570\u306f<a href=\"http:\/\/msdn.microsoft.com\/ja-jp\/library\/ff838328.aspx\" title=\"Rows \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 (Word)(\u6a5f\u68b0\u7ffb\u8a33)\" target=\"_blank\">Rows \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/a>\u306e<a href=\"http:\/\/msdn.microsoft.com\/ja-jp\/library\/ff198088.aspx\" title=\"Rows.Count \u30d7\u30ed\u30d1\u30c6\u30a3 (Word)(\u6a5f\u68b0\u7ffb\u8a33)\" target=\"_blank\">Count \u30d7\u30ed\u30d1\u30c6\u30a3<\/a>\u3092\u4f7f\u3063\u3066\u7c21\u5358\u306b\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Public Sub CountSelTableRows()\r\n  With Selection.Tables\r\n    If .Count &gt; 0 Then\r\n      MsgBox &quot;\u30ab\u30fc\u30bd\u30eb\u4f4d\u7f6e\u306e\u8868\u306e\u884c\u6570\u306f\u300c&quot; &amp; .Item(1).Rows.Count &amp; &quot;\u300d\u3067\u3059\u3002&quot;, vbSystemModal\r\n    End If\r\n  End With\r\nEnd Sub<\/pre>\n<p>\u305f\u3068\u3048\u3070\u4e0a\u8a18\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u30ab\u30fc\u30bd\u30eb\u4f4d\u7f6e\u306b\u3042\u308b\u8868\u306e\u884c\u6570\u3092MsgBox\u3067\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/CountSelTableRows_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/CountSelTableRows_01.jpg\" alt=\"CountSelTableRows_01\" width=\"415\" height=\"288\" class=\"alignnone size-full wp-image-4924\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/CountSelTableRows_01.jpg 415w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/CountSelTableRows_01-300x208.jpg 300w\" sizes=\"auto, (max-width: 415px) 100vw, 415px\" \/><\/a><\/p>\n<p>\u9006\u306b\u5217\u6570\u3092\u8abf\u3079\u305f\u3044\u3068\u304d\u306f\u300c<span style=\"color: #ff0000; font-weight: bold;\">Columns.Count<\/span>\u300d\u306e\u3088\u3046\u306b\u3001<a href=\"http:\/\/msdn.microsoft.com\/ja-jp\/library\/ff821526.aspx\" title=\"Columns \u30aa\u30d6\u30b8\u30a7\u30af\u30c8 (Word)(\u6a5f\u68b0\u7ffb\u8a33)\" target=\"_blank\">Columns \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/a>\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3059\u308c\u3070\u3001\u9078\u629e\u4e2d\u306e\u6587\u66f8\u306b\u3042\u308b\u8868\u306e\u884c\u6570\u3092\u9806\u756a\u306b\u53d6\u5f97\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u306e\u3067\u3001\u30de\u30af\u30ed\u3067\u8868\u306e\u884c\u6570\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u306b\u306f\u662f\u975e\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Public Sub CountTableRows()\r\n  Dim i As Long\r\n  \r\n  With ActiveDocument.Tables\r\n    For i = 1 To .Count\r\n      MsgBox i &amp; &quot;\u756a\u76ee\u306e\u8868\u306e\u884c\u6570\u306f\u300c&quot; &amp; .Item(i).Rows.Count &amp; &quot;\u300d\u3067\u3059\u3002&quot;, vbSystemModal\r\n    Next\r\n  End With\r\nEnd Sub<\/pre>\n","protected":false},"excerpt":{"rendered":"\u300cWord VBA \u8868 \u884c\u6570\u300d\u3068\u3044\u3063\u305f\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u3067\u306e\u30a2\u30af\u30bb\u30b9\u304c\u3042\u308a\u307e\u3057\u305f\u3002 Word\u30de\u30af\u30ed\u3067\u8868\u306e\u884c\u6570\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3092\u8abf\u3079\u3066\u3044\u308b\u65b9\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u3060\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u5b9f\u306f\u8868\u306e\u884c\u6570\u306fRows \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306eCount \u30d7\u30ed\u30d1\u30c6 [&hellip;]","protected":false},"author":1,"featured_media":7111,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"\u8efd\u30fc\u30fc\u3044\u30cd\u30bf\u3067\u3059\u3002 [\u9078\u629e\u4e2d\u306e\u8868\u306e\u884c\u6570\u3092\u53d6\u5f97\u3059\u308bWord\u30de\u30af\u30ed]","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,48],"tags":[],"class_list":["post-4923","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-excel-office"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Excel.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-1hp","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4923","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4923"}],"version-history":[{"count":3,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4923\/revisions"}],"predecessor-version":[{"id":4927,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4923\/revisions\/4927"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7111"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}