{"id":604,"date":"2025-03-23T00:33:34","date_gmt":"2025-03-22T15:33:34","guid":{"rendered":"https:\/\/hajidai.com\/excel\/2025\/03\/excel%e4%b8%8a%e7%b4%9a%e8%80%85%e5%bf%85%e8%a6%8b%ef%bc%81%e6%a5%ad%e5%8b%99%e5%8a%b9%e7%8e%87%e3%82%92%e5%8a%87%e7%9a%84%e3%81%ab%e5%90%91%e4%b8%8a%e3%81%95%e3%81%9b%e3%82%8b3%e3%81%a4%e3%81%ae\/"},"modified":"2025-03-23T00:33:34","modified_gmt":"2025-03-22T15:33:34","slug":"excel%e4%b8%8a%e7%b4%9a%e8%80%85%e5%bf%85%e8%a6%8b%ef%bc%81%e6%a5%ad%e5%8b%99%e5%8a%b9%e7%8e%87%e3%82%92%e5%8a%87%e7%9a%84%e3%81%ab%e5%90%91%e4%b8%8a%e3%81%95%e3%81%9b%e3%82%8b3%e3%81%a4%e3%81%ae","status":"publish","type":"post","link":"https:\/\/hajidai.com\/excel\/2025\/03\/excel%e4%b8%8a%e7%b4%9a%e8%80%85%e5%bf%85%e8%a6%8b%ef%bc%81%e6%a5%ad%e5%8b%99%e5%8a%b9%e7%8e%87%e3%82%92%e5%8a%87%e7%9a%84%e3%81%ab%e5%90%91%e4%b8%8a%e3%81%95%e3%81%9b%e3%82%8b3%e3%81%a4%e3%81%ae\/","title":{"rendered":"&#8220;Excel\u4e0a\u7d1a\u8005\u5fc5\u898b\uff01\u696d\u52d9\u52b9\u7387\u3092\u5287\u7684\u306b\u5411\u4e0a\u3055\u305b\u308b3\u3064\u306e\u9ad8\u5ea6\u306a\u30de\u30af\u30ed\u30c6\u30af\u30cb\u30c3\u30af&#8221;"},"content":{"rendered":"<h2>\u4e0a\u7d1a\u8005\u306e\u305f\u3081\u306eExcel\u30de\u30af\u30ed\u6d3b\u7528\u8853\uff1a\u696d\u52d9\u52b9\u7387\u5316\u306e\u6975\u610f<\/h2>\n<p>\u307e\u305a\u306f\u3001Excel\u3092\u4f7f\u3044\u3053\u306a\u3057\u3066\u3082\u3063\u3068\u697d\u3092\u3057\u305f\u3044\u3001\u696d\u52d9\u3092\u52b9\u7387\u5316\u3057\u305f\u3044\u4e0a\u7d1a\u8005\u306e\u65b9\u3005\u306b\u5411\u3051\u3066\u3001\u3059\u3050\u306b\u8a66\u305b\u308b\u30de\u30af\u30ed\u30b3\u30fc\u30c9\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>&#8220;`vba<br \/>\nSub \u81ea\u52d5\u30c7\u30fc\u30bf\u6574\u7406()<br \/>\n    Dim ws As Worksheet<br \/>\n    Set ws = ActiveSheet<\/p>\n<p>    &#8216; \u30c7\u30fc\u30bf\u306e\u4e26\u3079\u66ff\u3048<br \/>\n    ws.Sort.SortFields.Clear<br \/>\n    ws.Sort.SortFields.Add Key:=Range(&#8220;A1&#8221;), SortOn:=xlSortOnValues, Order:=xlAscending<br \/>\n    ws.Sort.SetRange Range(&#8220;A1:C100&#8221;)<br \/>\n    ws.Sort.Header = xlYes<br \/>\n    ws.Sort.Apply<\/p>\n<p>    &#8216; \u91cd\u8907\u30c7\u30fc\u30bf\u306e\u524a\u9664<br \/>\n    ws.Range(&#8220;A1:C100&#8221;).RemoveDuplicates Columns:=Array(1, 2, 3), Header:=xlYes<\/p>\n<p>    &#8216; \u6761\u4ef6\u4ed8\u304d\u66f8\u5f0f\u306e\u9069\u7528<br \/>\n    ws.Range(&#8220;C1:C100&#8243;).FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, Formula1:=&#8221;1000&#8221;<br \/>\n    ws.Range(&#8220;C1:C100&#8221;).FormatConditions(1).Interior.Color = RGB(255, 200, 200)<br \/>\nEnd Sub<br \/>\n&#8220;`<\/p>\n<p>\u3053\u306e\u30de\u30af\u30ed\u306f\u3001\u30c7\u30fc\u30bf\u306e\u4e26\u3079\u66ff\u3048\u3001\u91cd\u8907\u524a\u9664\u3001\u6761\u4ef6\u4ed8\u304d\u66f8\u5f0f\u306e\u9069\u7528\u3092\u81ea\u52d5\u3067\u884c\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u77ac\u6642\u306b\u6574\u7406\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>1. \u30de\u30af\u30ed\u3092\u6d3b\u7528\u3057\u305f\u30c7\u30fc\u30bf\u51e6\u7406\u306e\u81ea\u52d5\u5316<\/h3>\n<p>Excel\u30de\u30af\u30ed\u306f\u3001\u7e70\u308a\u8fd4\u3057\u884c\u3046\u4f5c\u696d\u3092\u81ea\u52d5\u5316\u3059\u308b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u306f\u3001\u30c7\u30fc\u30bf\u6574\u7406\u306e\u57fa\u672c\u7684\u306a\u30b9\u30c6\u30c3\u30d7\u3092\u81ea\u52d5\u5316\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u3092\u30d9\u30fc\u30b9\u306b\u81ea\u5206\u306e\u696d\u52d9\u306b\u5408\u308f\u305b\u3066\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u3053\u3068\u3067\u3001\u3055\u3089\u306a\u308b\u52b9\u7387\u5316\u304c\u53ef\u80fd\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001\u7279\u5b9a\u306e\u6761\u4ef6\u306b\u57fa\u3065\u3044\u3066\u30c7\u30fc\u30bf\u3092\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3057\u305f\u308a\u3001\u8907\u6570\u306e\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u306b\u307e\u305f\u304c\u308b\u51e6\u7406\u3092\u4e00\u62ec\u3067\u884c\u3063\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>2. VBA\u3092\u4f7f\u3063\u305f\u9ad8\u5ea6\u306a\u30c7\u30fc\u30bf\u5206\u6790<\/h3>\n<p>Excel\u30de\u30af\u30ed\u306e\u771f\u4fa1\u306f\u3001VBA\uff08Visual Basic for Applications\uff09\u3092\u4f7f\u3063\u305f\u9ad8\u5ea6\u306a\u30c7\u30fc\u30bf\u5206\u6790\u306b\u3042\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u304b\u3089\u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u62bd\u51fa\u3057\u305f\u308a\u3001\u8907\u96d1\u306a\u8a08\u7b97\u3092\u4e00\u62ec\u3067\u5b9f\u884c\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002\u4ee5\u4e0b\u306f\u3001\u58f2\u4e0a\u30c7\u30fc\u30bf\u304b\u3089\u6708\u6b21\u30ec\u30dd\u30fc\u30c8\u3092\u81ea\u52d5\u751f\u6210\u3059\u308b\u30de\u30af\u30ed\u306e\u4e00\u4f8b\u3067\u3059\u3002<\/p>\n<p>&#8220;`vba<br \/>\nSub \u6708\u6b21\u30ec\u30dd\u30fc\u30c8\u4f5c\u6210()<br \/>\n    Dim ws As Worksheet<br \/>\n    Dim lastRow As Long<\/p>\n<p>    Set ws = ThisWorkbook.Sheets(&#8220;\u58f2\u4e0a\u30c7\u30fc\u30bf&#8221;)<br \/>\n    lastRow = ws.Cells(ws.Rows.Count, &#8220;A&#8221;).End(xlUp).Row<\/p>\n<p>    &#8216; \u30d4\u30dc\u30c3\u30c8\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210<br \/>\n    ws.Range(&#8220;A1:D&#8221; &#038; lastRow).Select<br \/>\n    ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _<br \/>\n        ws.Name &#038; &#8220;!R1C1:R&#8221; &#038; lastRow &#038; &#8220;C4&#8243;, Version:=6).CreatePivotTable _<br \/>\n        TableDestination:=&#8221;\u30ec\u30dd\u30fc\u30c8!R3C1&#8243;, TableName:=&#8221;\u58f2\u4e0a\u30b5\u30de\u30ea\u30fc&#8221;, DefaultVersion:=6<\/p>\n<p>    &#8216; \u30d4\u30dc\u30c3\u30c8\u30c6\u30fc\u30d6\u30eb\u306e\u8a2d\u5b9a<br \/>\n    With ActiveSheet.PivotTables(&#8220;\u58f2\u4e0a\u30b5\u30de\u30ea\u30fc&#8221;)<br \/>\n        .PivotFields(&#8220;\u65e5\u4ed8&#8221;).Orientation = xlRowField<br \/>\n        .PivotFields(&#8220;\u65e5\u4ed8&#8221;).Position = 1<br \/>\n        .PivotFields(&#8220;\u5546\u54c1&#8221;).Orientation = xlColumnField<br \/>\n        .PivotFields(&#8220;\u5546\u54c1&#8221;).Position = 1<br \/>\n        .AddDataField ActiveSheet.PivotTables(&#8220;\u58f2\u4e0a\u30b5\u30de\u30ea\u30fc&#8221;).PivotFields(&#8220;\u58f2\u4e0a&#8221;), &#8220;\u5408\u8a08 \u58f2\u4e0a&#8221;, xlSum<br \/>\n    End With<br \/>\nEnd Sub<br \/>\n&#8220;`<\/p>\n<p>\u3053\u306e\u30de\u30af\u30ed\u306f\u3001\u58f2\u4e0a\u30c7\u30fc\u30bf\u304b\u3089\u30d4\u30dc\u30c3\u30c8\u30c6\u30fc\u30d6\u30eb\u3092\u81ea\u52d5\u751f\u6210\u3057\u3001\u6708\u6b21\u30ec\u30dd\u30fc\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30c7\u30fc\u30bf\u5206\u6790\u306b\u304b\u304b\u308b\u6642\u9593\u3092\u5927\u5e45\u306b\u524a\u6e1b\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>3. \u30de\u30af\u30ed\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3068\u5171\u6709<\/h3>\n<p>Excel\u30de\u30af\u30ed\u306f\u975e\u5e38\u306b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u304c\u3001\u540c\u6642\u306b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3082\u4f34\u3044\u307e\u3059\u3002\u30de\u30af\u30ed\u3092\u542b\u3080\u30d5\u30a1\u30a4\u30eb\u3092\u4ed6\u8005\u3068\u5171\u6709\u3059\u308b\u969b\u306f\u3001\u4ee5\u4e0b\u306e\u70b9\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\uff1a<\/p>\n<p>1. \u30de\u30af\u30ed\u306e\u5185\u5bb9\u3092\u5341\u5206\u306b\u78ba\u8a8d\u3057\u3001\u4e0d\u8981\u306a\u30b3\u30fc\u30c9\u3084\u6a5f\u5bc6\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u304b\u78ba\u8a8d\u3059\u308b\u3002<br \/>\n2. \u30de\u30af\u30ed\u3092\u542b\u3080\u30d5\u30a1\u30a4\u30eb\u3092\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u4fdd\u8b77\u3057\u3001\u8a31\u53ef\u3055\u308c\u305f\u4eba\u306e\u307f\u304c\u7de8\u96c6\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002<br \/>\n3. \u5171\u6709\u76f8\u624b\u306b\u3001\u30de\u30af\u30ed\u306e\u6a5f\u80fd\u3068\u4f7f\u7528\u65b9\u6cd5\u3092\u660e\u78ba\u306b\u8aac\u660e\u3059\u308b\u3002<\/p>\n<p>\u307e\u305f\u3001\u30de\u30af\u30ed\u306e\u958b\u767a\u3068\u5171\u6709\u306b\u306f\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u30c4\u30fc\u30eb\u306e\u4f7f\u7528\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002GitHub\u306a\u3069\u306e\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30b3\u30fc\u30c9\u306e\u5909\u66f4\u5c65\u6b74\u3092\u8ffd\u8de1\u3057\u3001\u8907\u6570\u4eba\u3067\u306e\u5171\u540c\u958b\u767a\u3082\u5bb9\u6613\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>Excel\u30de\u30af\u30ed\u306f\u3001\u9069\u5207\u306b\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u696d\u52d9\u52b9\u7387\u3092\u98db\u8e8d\u7684\u306b\u5411\u4e0a\u3055\u305b\u308b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002\u57fa\u672c\u7684\u306a\u81ea\u52d5\u5316\u304b\u3089\u9ad8\u5ea6\u306a\u30c7\u30fc\u30bf\u5206\u6790\u307e\u3067\u3001\u5e45\u5e83\u3044\u7528\u9014\u306b\u5bfe\u5fdc\u3067\u304d\u308b\u305f\u3081\u3001\u4e0a\u7d1a\u8005\u306e\u65b9\u3005\u306b\u3068\u3063\u3066\u306f\u5fc5\u9808\u306e\u30b9\u30ad\u30eb\u3068\u8a00\u3048\u308b\u3067\u3057\u3087\u3046\u3002\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306b\u914d\u616e\u3057\u3064\u3064\u3001\u81ea\u8eab\u306e\u696d\u52d9\u306b\u5408\u308f\u305b\u3066\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u3066\u3044\u304f\u3053\u3068\u3067\u3001\u771f\u306e\u696d\u52d9\u52b9\u7387\u5316\u3092\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u7d1a\u8005\u306e\u305f\u3081\u306eExcel\u30de\u30af\u30ed\u6d3b\u7528\u8853\uff1a\u696d\u52d9\u52b9\u7387\u5316\u306e\u6975\u610f \u307e\u305a\u306f\u3001Excel\u3092\u4f7f\u3044\u3053\u306a\u3057\u3066\u3082\u3063\u3068\u697d\u3092\u3057\u305f\u3044\u3001\u696d\u52d9\u3092\u52b9\u7387\u5316\u3057\u305f\u3044\u4e0a\u7d1a\u8005\u306e\u65b9\u3005\u306b\u5411\u3051\u3066\u3001\u3059\u3050\u306b\u8a66\u305b\u308b\u30de\u30af\u30ed\u30b3\u30fc\u30c9\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002 #8220;`vba Sub <\/p>\n","protected":false},"author":2,"featured_media":603,"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-604","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\/604","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=604"}],"version-history":[{"count":0,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts\/604\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/media\/603"}],"wp:attachment":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/media?parent=604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/categories?post=604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/tags?post=604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}