{"id":382,"date":"2025-01-05T02:33:34","date_gmt":"2025-01-04T17:33:34","guid":{"rendered":"https:\/\/hajidai.com\/excel\/2025\/01\/excel%e3%83%9e%e3%82%af%e3%83%ad%e3%81%a7%e6%a5%b5%e3%82%81%e3%82%8b%ef%bc%81%e4%b8%8a%e7%b4%9a%e8%80%85%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e5%8b%95%e7%9a%84%e3%83%ac%e3%83%9d%e3%83%bc%e3%83%86\/"},"modified":"2025-01-05T02:33:34","modified_gmt":"2025-01-04T17:33:34","slug":"excel%e3%83%9e%e3%82%af%e3%83%ad%e3%81%a7%e6%a5%b5%e3%82%81%e3%82%8b%ef%bc%81%e4%b8%8a%e7%b4%9a%e8%80%85%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e5%8b%95%e7%9a%84%e3%83%ac%e3%83%9d%e3%83%bc%e3%83%86","status":"publish","type":"post","link":"https:\/\/hajidai.com\/excel\/2025\/01\/excel%e3%83%9e%e3%82%af%e3%83%ad%e3%81%a7%e6%a5%b5%e3%82%81%e3%82%8b%ef%bc%81%e4%b8%8a%e7%b4%9a%e8%80%85%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e5%8b%95%e7%9a%84%e3%83%ac%e3%83%9d%e3%83%bc%e3%83%86\/","title":{"rendered":"Excel\u30de\u30af\u30ed\u3067\u6975\u3081\u308b\uff01\u4e0a\u7d1a\u8005\u306e\u305f\u3081\u306e\u52d5\u7684\u30ec\u30dd\u30fc\u30c6\u30a3\u30f3\u30b0\u81ea\u52d5\u5316\u30c6\u30af\u30cb\u30c3\u30af"},"content":{"rendered":"<h2>\u52d5\u7684\u30ec\u30dd\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u6975\u610f\uff01\u4e0a\u7d1a\u8005\u5411\u3051\u30de\u30af\u30ed\u306b\u3088\u308b\u81ea\u52d5\u5206\u6790\u30c6\u30af\u30cb\u30c3\u30af<\/h2>\n<h3>\u3059\u3050\u306b\u8a66\u305b\u308b\u4e0a\u7d1a\u8005\u5411\u3051\u30de\u30af\u30ed\u30b3\u30fc\u30c9<\/h3>\n<p>&#8220;`vba<br \/>\nSub \u52d5\u7684\u30c7\u30fc\u30bf\u5206\u6790()<br \/>\n    Dim ws As Worksheet<br \/>\n    Dim lastRow As Long, lastCol As Long<br \/>\n    Dim pvt As PivotTable<\/p>\n<p>    Set ws = ThisWorkbook.Sheets(&#8220;\u30c7\u30fc\u30bf&#8221;)<br \/>\n    lastRow = ws.Cells(ws.Rows.Count, &#8220;A&#8221;).End(xlUp).Row<br \/>\n    lastCol = ws.Cells(1, ws.Columns.Count).End(xlToLeft).Column<\/p>\n<p>    &#8216; \u30d4\u30dc\u30c3\u30c8\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210<br \/>\n    Set pvt = ThisWorkbook.Sheets.Add.PivotTables.Add( _<br \/>\n        SourceType:=xlDatabase, _<br \/>\n        SourceData:=ws.Range(ws.Cells(1, 1), ws.Cells(lastRow, lastCol)), _<br \/>\n        TableDestination:=Range(&#8220;A3&#8243;))<\/p>\n<p>    &#8216; \u30d4\u30dc\u30c3\u30c8\u30c6\u30fc\u30d6\u30eb\u306e\u8a2d\u5b9a<br \/>\n    With pvt<br \/>\n        .AddFields RowFields:=&#8221;\u30ab\u30c6\u30b4\u30ea&#8221;, ColumnFields:=&#8221;\u6708&#8221;<br \/>\n        .AddDataField .PivotFields(&#8220;\u58f2\u4e0a&#8221;), &#8220;\u5408\u8a08 \u58f2\u4e0a&#8221;, xlSum<br \/>\n    End With<\/p>\n<p>    &#8216; \u30b0\u30e9\u30d5\u306e\u4f5c\u6210<br \/>\n    pvt.ChartObjects.Add(Left:=300, Width:=300, Top:=15, Height:=200).Chart. _<br \/>\n        SetSourceData Source:=pvt.TableRange1<br \/>\nEnd Sub<br \/>\n&#8220;`<\/p>\n<p>\u3053\u306e\u30de\u30af\u30ed\u306f\u3001\u300c\u30c7\u30fc\u30bf\u300d\u30b7\u30fc\u30c8\u306e\u60c5\u5831\u3092\u57fa\u306b\u30d4\u30dc\u30c3\u30c8\u30c6\u30fc\u30d6\u30eb\u3068\u30b0\u30e9\u30d5\u3092\u81ea\u52d5\u751f\u6210\u3057\u307e\u3059\u3002Excel \u30de\u30af\u30ed\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u8907\u96d1\u306a\u5206\u6790\u4f5c\u696d\u3092\u77ac\u6642\u306b\u884c\u3048\u307e\u3059\u3002<\/p>\n<h3>1. \u52d5\u7684\u30ec\u30dd\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u57fa\u672c<\/h3>\n<p>\u52d5\u7684\u30ec\u30dd\u30fc\u30c6\u30a3\u30f3\u30b0\u3068\u306f\u3001\u30c7\u30fc\u30bf\u306e\u5909\u66f4\u306b\u5fdc\u3058\u3066\u81ea\u52d5\u7684\u306b\u66f4\u65b0\u3055\u308c\u308b\u30ec\u30dd\u30fc\u30c8\u306e\u3053\u3068\u3067\u3059\u3002Excel \u30de\u30af\u30ed\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u3053\u306e\u52d5\u7684\u306a\u6027\u8cea\u3092\u6700\u5927\u9650\u306b\u6d3b\u304b\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4e0a\u8a18\u306e\u30de\u30af\u30ed\u3067\u306f\u3001\u30c7\u30fc\u30bf\u30b7\u30fc\u30c8\u306e\u5185\u5bb9\u304c\u5909\u308f\u3063\u3066\u3082\u3001\u30d4\u30dc\u30c3\u30c8\u30c6\u30fc\u30d6\u30eb\u3068\u30b0\u30e9\u30d5\u304c\u81ea\u52d5\u7684\u306b\u66f4\u65b0\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u6700\u65b0\u306e\u30c7\u30fc\u30bf\u3092\u5e38\u306b\u53cd\u6620\u3057\u305f\u30ec\u30dd\u30fc\u30c8\u3092\u7c21\u5358\u306b\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>2. \u30de\u30af\u30ed\u306b\u3088\u308b\u81ea\u52d5\u5316\u306e\u5229\u70b9<\/h3>\n<p>Excel \u30de\u30af\u30ed\u3092\u4f7f\u7528\u3057\u305f\u81ea\u52d5\u5316\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5229\u70b9\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n<p>1. \u6642\u9593\u306e\u7bc0\u7d04\uff1a\u7e70\u308a\u8fd4\u3057\u884c\u3046\u4f5c\u696d\u3092\u81ea\u52d5\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u5927\u5e45\u306a\u6642\u9593\u77ed\u7e2e\u304c\u53ef\u80fd\u3067\u3059\u3002<br \/>\n2. \u30df\u30b9\u306e\u524a\u6e1b\uff1a\u4eba\u9593\u306e\u624b\u4f5c\u696d\u306b\u3088\u308b\u30a8\u30e9\u30fc\u3092\u6e1b\u3089\u3057\u3001\u30c7\u30fc\u30bf\u306e\u6b63\u78ba\u6027\u3092\u9ad8\u3081\u307e\u3059\u3002<br \/>\n3. \u4e00\u8cab\u6027\u306e\u7dad\u6301\uff1a\u540c\u3058\u51e6\u7406\u3092\u5e38\u306b\u540c\u3058\u65b9\u6cd5\u3067\u5b9f\u884c\u3059\u308b\u305f\u3081\u3001\u30ec\u30dd\u30fc\u30c8\u306e\u4e00\u8cab\u6027\u304c\u4fdd\u305f\u308c\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u8a18\u306e\u30de\u30af\u30ed\u3092\u4f8b\u306b\u3068\u308b\u3068\u3001\u30c7\u30fc\u30bf\u306e\u66f4\u65b0\u304b\u3089\u30d4\u30dc\u30c3\u30c8\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\u3001\u30b0\u30e9\u30d5\u306e\u751f\u6210\u307e\u3067\u3001\u3059\u3079\u3066\u3092\u4e00\u5ea6\u306e\u30dc\u30bf\u30f3\u30af\u30ea\u30c3\u30af\u3067\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5206\u6790\u4f5c\u696d\u306e\u52b9\u7387\u304c\u5287\u7684\u306b\u5411\u4e0a\u3057\u307e\u3059\u3002<\/p>\n<h3>3. \u4e0a\u7d1a\u8005\u5411\u3051\u30c6\u30af\u30cb\u30c3\u30af\u306e\u6d3b\u7528<\/h3>\n<p>\u4e0a\u7d1a\u8005\u5411\u3051\u306e Excel \u30de\u30af\u30ed\u30c6\u30af\u30cb\u30c3\u30af\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u3055\u3089\u306b\u9ad8\u5ea6\u306a\u52d5\u7684\u30ec\u30dd\u30fc\u30c6\u30a3\u30f3\u30b0\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\uff1a<\/p>\n<p>1. \u6761\u4ef6\u4ed8\u304d\u66f8\u5f0f\u306e\u52d5\u7684\u9069\u7528\uff1a\u30de\u30af\u30ed\u3092\u4f7f\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u306e\u5185\u5bb9\u306b\u5fdc\u3058\u3066\u81ea\u52d5\u7684\u306b\u6761\u4ef6\u4ed8\u304d\u66f8\u5f0f\u3092\u9069\u7528\u3067\u304d\u307e\u3059\u3002<br \/>\n2. \u52d5\u7684\u306a\u30c7\u30fc\u30bf\u7bc4\u56f2\u306e\u8a2d\u5b9a\uff1a\u30c7\u30fc\u30bf\u306e\u5897\u6e1b\u306b\u5fdc\u3058\u3066\u3001\u81ea\u52d5\u7684\u306b\u5206\u6790\u5bfe\u8c61\u7bc4\u56f2\u3092\u8abf\u6574\u3059\u308b\u30de\u30af\u30ed\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<br \/>\n3. \u30ab\u30b9\u30bf\u30e0\u30e6\u30fc\u30b6\u30fc\u30d5\u30a9\u30fc\u30e0\uff1a\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u3092\u4f5c\u6210\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u9078\u629e\u306b\u57fa\u3065\u3044\u3066\u52d5\u7684\u306b\u30ec\u30dd\u30fc\u30c8\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4e0a\u8a18\u306e\u30de\u30af\u30ed\u3092\u62e1\u5f35\u3057\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u9078\u629e\u3057\u305f\u30ab\u30c6\u30b4\u30ea\u3084\u671f\u9593\u306b\u57fa\u3065\u3044\u3066\u30d4\u30dc\u30c3\u30c8\u30c6\u30fc\u30d6\u30eb\u3068\u30b0\u30e9\u30d5\u3092\u751f\u6210\u3059\u308b\u3088\u3046\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u3088\u308a\u67d4\u8edf\u3067\u52d5\u7684\u306a\u30ec\u30dd\u30fc\u30c6\u30a3\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u3092\u69cb\u7bc9\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>Excel \u30de\u30af\u30ed\u3092\u6d3b\u7528\u3057\u305f\u52d5\u7684\u30ec\u30dd\u30fc\u30c6\u30a3\u30f3\u30b0\u306f\u3001\u30c7\u30fc\u30bf\u5206\u6790\u4f5c\u696d\u3092\u5927\u5e45\u306b\u52b9\u7387\u5316\u3057\u3001\u610f\u601d\u6c7a\u5b9a\u306e\u30b9\u30d4\u30fc\u30c9\u3092\u5411\u4e0a\u3055\u305b\u307e\u3059\u3002\u4e0a\u7d1a\u8005\u5411\u3051\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u7fd2\u5f97\u3057\u3001\u81ea\u793e\u306e\u696d\u52d9\u306b\u5408\u308f\u305b\u3066\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u3053\u3068\u3067\u3001\u3055\u3089\u306a\u308b\u696d\u52d9\u6539\u5584\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u52d5\u7684\u30ec\u30dd\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u6975\u610f\uff01\u4e0a\u7d1a\u8005\u5411\u3051\u30de\u30af\u30ed\u306b\u3088\u308b\u81ea\u52d5\u5206\u6790\u30c6\u30af\u30cb\u30c3\u30af \u3059\u3050\u306b\u8a66\u305b\u308b\u4e0a\u7d1a\u8005\u5411\u3051\u30de\u30af\u30ed\u30b3\u30fc\u30c9 #8220;`vba Sub \u52d5\u7684\u30c7\u30fc\u30bf\u5206\u6790() Dim ws As Worksheet Dim lastRow <\/p>\n","protected":false},"author":2,"featured_media":381,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-382","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advanced"],"_links":{"self":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts\/382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/comments?post=382"}],"version-history":[{"count":0,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts\/382\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/media\/381"}],"wp:attachment":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/media?parent=382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/categories?post=382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/tags?post=382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}