{"id":490,"date":"2025-01-28T00:33:35","date_gmt":"2025-01-27T15:33:35","guid":{"rendered":"https:\/\/hajidai.com\/excel\/2025\/01\/excel%e3%83%9e%e3%82%af%e3%83%ad%e3%81%a7%e4%bd%9c%e3%82%8b%e5%8b%95%e7%9a%84%e3%82%a4%e3%83%b3%e3%82%bf%e3%83%a9%e3%82%af%e3%83%86%e3%82%a3%e3%83%96%e3%82%b0%e3%83%a9%e3%83%95%ef%bc%9a%e3%83%87\/"},"modified":"2025-01-28T00:33:35","modified_gmt":"2025-01-27T15:33:35","slug":"excel%e3%83%9e%e3%82%af%e3%83%ad%e3%81%a7%e4%bd%9c%e3%82%8b%e5%8b%95%e7%9a%84%e3%82%a4%e3%83%b3%e3%82%bf%e3%83%a9%e3%82%af%e3%83%86%e3%82%a3%e3%83%96%e3%82%b0%e3%83%a9%e3%83%95%ef%bc%9a%e3%83%87","status":"publish","type":"post","link":"https:\/\/hajidai.com\/excel\/2025\/01\/excel%e3%83%9e%e3%82%af%e3%83%ad%e3%81%a7%e4%bd%9c%e3%82%8b%e5%8b%95%e7%9a%84%e3%82%a4%e3%83%b3%e3%82%bf%e3%83%a9%e3%82%af%e3%83%86%e3%82%a3%e3%83%96%e3%82%b0%e3%83%a9%e3%83%95%ef%bc%9a%e3%83%87\/","title":{"rendered":"Excel\u30de\u30af\u30ed\u3067\u4f5c\u308b\u52d5\u7684\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u30b0\u30e9\u30d5\uff1a\u30c7\u30fc\u30bf\u5206\u6790\u3068\u610f\u601d\u6c7a\u5b9a\u3092\u52a0\u901f\u3055\u305b\u308b\u79d8\u8a23"},"content":{"rendered":"<h2>Excel\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\u4eba\u304c\u3059\u3050\u306b\u8a66\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u30de\u30af\u30ed\u30b3\u30fc\u30c9<\/h2>\n<p>&#8220;`vba<br \/>\nSub CreateInteractiveChart()<br \/>\n    Dim ws As Worksheet<br \/>\n    Dim cht As ChartObject<br \/>\n    Dim rng As Range<\/p>\n<p>    Set ws = ActiveSheet<br \/>\n    Set rng = ws.Range(&#8220;A1:C10&#8221;) &#8216; \u30c7\u30fc\u30bf\u7bc4\u56f2\u3092\u8abf\u6574\u3057\u3066\u304f\u3060\u3055\u3044<\/p>\n<p>    &#8216; \u65e2\u5b58\u306e\u30b0\u30e9\u30d5\u3092\u524a\u9664<br \/>\n    For Each cht In ws.ChartObjects<br \/>\n        cht.Delete<br \/>\n    Next cht<\/p>\n<p>    &#8216; \u65b0\u3057\u3044\u30b0\u30e9\u30d5\u3092\u4f5c\u6210<br \/>\n    Set cht = ws.ChartObjects.Add(Left:=200, Width:=375, Top:=75, Height:=225)<\/p>\n<p>    With cht.Chart<br \/>\n        .SetSourceData Source:=rng<br \/>\n        .ChartType = xlColumnClustered<br \/>\n        .HasTitle = True<br \/>\n        .ChartTitle.Text = &#8220;\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u30b0\u30e9\u30d5&#8221;<br \/>\n    End With<\/p>\n<p>    &#8216; \u30b0\u30e9\u30d5\u306e\u66f4\u65b0\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0<br \/>\n    ws.Buttons.Add(500, 50, 80, 30).OnAction = &#8220;UpdateChart&#8221;<br \/>\nEnd Sub<\/p>\n<p>Sub UpdateChart()<br \/>\n    ActiveSheet.ChartObjects(1).Chart.Refresh<br \/>\nEnd Sub<br \/>\n&#8220;`<\/p>\n<h3>1. \u52d5\u7684\u30b0\u30e9\u30d5\u306e\u91cd\u8981\u6027<\/h3>\n<p>Excel \u30de\u30af\u30ed\u3092\u6d3b\u7528\u3057\u305f\u52d5\u7684\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u30b0\u30e9\u30d5\u306f\u3001\u30c7\u30fc\u30bf\u53ef\u8996\u5316\u306e\u6700\u524d\u7dda\u3067\u6ce8\u76ee\u3092\u96c6\u3081\u3066\u3044\u307e\u3059\u3002\u9759\u7684\u306a\u30b0\u30e9\u30d5\u3068\u306f\u7570\u306a\u308a\u3001\u30c7\u30fc\u30bf\u306e\u5909\u66f4\u306b\u5fdc\u3058\u3066\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u66f4\u65b0\u3055\u308c\u308b\u52d5\u7684\u30b0\u30e9\u30d5\u306f\u3001\u30d3\u30b8\u30cd\u30b9\u306e\u610f\u601d\u6c7a\u5b9a\u306b\u304a\u3044\u3066\u975e\u5e38\u306b\u6709\u7528\u3067\u3059\u3002<\/p>\n<p>\u4e0a\u8a18\u306e\u30de\u30af\u30ed\u30b3\u30fc\u30c9\u306f\u3001\u57fa\u672c\u7684\u306a\u52d5\u7684\u30b0\u30e9\u30d5\u3092\u4f5c\u6210\u3059\u308b\u4f8b\u3067\u3059\u3002\u3053\u306e\u30de\u30af\u30ed\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u6307\u5b9a\u3057\u305f\u30c7\u30fc\u30bf\u7bc4\u56f2\u304b\u3089\u30b0\u30e9\u30d5\u304c\u81ea\u52d5\u751f\u6210\u3055\u308c\u3001\u3055\u3089\u306b\u30b0\u30e9\u30d5\u3092\u66f4\u65b0\u3059\u308b\u305f\u3081\u306e\u30dc\u30bf\u30f3\u3082\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30c7\u30fc\u30bf\u304c\u5909\u66f4\u3055\u308c\u305f\u3068\u304d\u306b\u7c21\u5358\u306b\u30b0\u30e9\u30d5\u3092\u66f4\u65b0\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u52d5\u7684\u30b0\u30e9\u30d5\u306e\u5229\u70b9\u306f\u3001\u30c7\u30fc\u30bf\u306e\u5909\u5316\u3092\u5373\u5ea7\u306b\u8996\u899a\u5316\u3067\u304d\u308b\u3053\u3068\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001\u6708\u6b21\u306e\u58f2\u4e0a\u30c7\u30fc\u30bf\u3092\u6271\u3046\u5834\u5408\u3001\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u304c\u5165\u529b\u3055\u308c\u308b\u305f\u3073\u306b\u30b0\u30e9\u30d5\u304c\u81ea\u52d5\u66f4\u65b0\u3055\u308c\u308c\u3070\u3001\u30c8\u30ec\u30f3\u30c9\u306e\u5909\u5316\u3092\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u628a\u63e1\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>2. \u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u8981\u7d20\u306e\u8ffd\u52a0<\/h3>\n<p>Excel \u30de\u30af\u30ed\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30b0\u30e9\u30d5\u306b\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306a\u8981\u7d20\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u30ea\u30b9\u30c8\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u306e\u8868\u793a\u7bc4\u56f2\u3092\u5909\u66f4\u3057\u305f\u308a\u3001\u30b9\u30e9\u30a4\u30c0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u306e\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3092\u884c\u3063\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306f\u3001\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u30ea\u30b9\u30c8\u3092\u4f7f\u7528\u3057\u3066\u30b0\u30e9\u30d5\u306e\u8868\u793a\u30c7\u30fc\u30bf\u3092\u5207\u308a\u66ff\u3048\u308b\u30de\u30af\u30ed\u306e\u4f8b\u3067\u3059\uff1a<\/p>\n<p>&#8220;`vba<br \/>\nSub AddInteractiveDropdown()<br \/>\n    Dim ws As Worksheet<br \/>\n    Dim dropdown As DropDown<\/p>\n<p>    Set ws = ActiveSheet<\/p>\n<p>    &#8216; \u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u30ea\u30b9\u30c8\u3092\u8ffd\u52a0<br \/>\n    Set dropdown = ws.DropDowns.Add(100, 50, 100, 20)<br \/>\n    With dropdown<br \/>\n        .AddItem &#8220;\u65e5\u6b21\u30c7\u30fc\u30bf&#8221;<br \/>\n        .AddItem &#8220;\u9031\u6b21\u30c7\u30fc\u30bf&#8221;<br \/>\n        .AddItem &#8220;\u6708\u6b21\u30c7\u30fc\u30bf&#8221;<br \/>\n    End With<\/p>\n<p>    &#8216; \u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u30ea\u30b9\u30c8\u306e\u5909\u66f4\u30a4\u30d9\u30f3\u30c8\u3092\u8a2d\u5b9a<br \/>\n    ws.DropDowns(1).OnAction = &#8220;UpdateChartBasedOnSelection&#8221;<br \/>\nEnd Sub<\/p>\n<p>Sub UpdateChartBasedOnSelection()<br \/>\n    &#8216; \u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u306e\u9078\u629e\u306b\u57fa\u3065\u3044\u3066\u30b0\u30e9\u30d5\u3092\u66f4\u65b0\u3059\u308b\u30ed\u30b8\u30c3\u30af\u3092\u3053\u3053\u306b\u8a18\u8ff0<br \/>\nEnd Sub<br \/>\n&#8220;`<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u8981\u7d20\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u306f\u30c7\u30fc\u30bf\u306e\u7570\u306a\u308b\u5074\u9762\u3092\u7c21\u5358\u306b\u63a2\u7d22\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u7279\u306b\u3001\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u6271\u3046\u5834\u5408\u3084\u3001\u8907\u6570\u306e\u8996\u70b9\u304b\u3089\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306b\u975e\u5e38\u306b\u6709\u52b9\u3067\u3059\u3002<\/p>\n<h3>3. \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u30e6\u30fc\u30b6\u30d3\u30ea\u30c6\u30a3\u306e\u6700\u9069\u5316<\/h3>\n<p>\u52d5\u7684\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u30b0\u30e9\u30d5\u3092\u4f5c\u6210\u3059\u308b\u969b\u306f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u30e6\u30fc\u30b6\u30d3\u30ea\u30c6\u30a3\u306e\u6700\u9069\u5316\u304c\u91cd\u8981\u3067\u3059\u3002\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u6271\u3046\u5834\u5408\u3001\u30b0\u30e9\u30d5\u306e\u66f4\u65b0\u306b\u6642\u9593\u304c\u304b\u304b\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3092\u6539\u5584\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u306e\u307f\u3092\u51e6\u7406\u3059\u308b\u3088\u3046\u306b\u30de\u30af\u30ed\u3092\u6700\u9069\u5316\u3059\u308b\u3053\u3068\u304c\u5927\u5207\u3067\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u30e6\u30fc\u30b6\u30fc\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u8a2d\u8a08\u3082\u91cd\u8981\u3067\u3059\u3002\u76f4\u611f\u7684\u306b\u64cd\u4f5c\u3067\u304d\u308b\u30dc\u30bf\u30f3\u3084\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u9069\u5207\u306b\u914d\u7f6e\u3059\u308b\u3053\u3068\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u30a8\u30af\u30b9\u30da\u30ea\u30a8\u30f3\u30b9\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30de\u30af\u30ed\u3092\u4f7f\u7528\u3057\u3066\u3001\u30b0\u30e9\u30d5\u306e\u66f4\u65b0\u4e2d\u306b\u30d7\u30ed\u30b0\u30ec\u30b9\u30d0\u30fc\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a<\/p>\n<p>&#8220;`vba<br \/>\nSub UpdateChartWithProgressBar()<br \/>\n    Dim i As Long<br \/>\n    Dim totalSteps As Long<\/p>\n<p>    totalSteps = 100 &#8216; \u66f4\u65b0\u306e\u7dcf\u30b9\u30c6\u30c3\u30d7\u6570<\/p>\n<p>    &#8216; \u30d7\u30ed\u30b0\u30ec\u30b9\u30d0\u30fc\u3092\u8868\u793a<br \/>\n    Application.StatusBar = &#8220;\u30b0\u30e9\u30d5\u3092\u66f4\u65b0\u4e2d: 0%&#8221;<\/p>\n<p>    For i = 1 To totalSteps<br \/>\n        &#8216; \u30b0\u30e9\u30d5\u66f4\u65b0\u306e\u51e6\u7406\u3092\u3053\u3053\u306b\u8a18\u8ff0<\/p>\n<p>        &#8216; \u30d7\u30ed\u30b0\u30ec\u30b9\u30d0\u30fc\u3092\u66f4\u65b0<br \/>\n        Application.StatusBar = &#8220;\u30b0\u30e9\u30d5\u3092\u66f4\u65b0\u4e2d: &#8221; &#038; Format(i \/ totalSteps, &#8220;0%&#8221;)<br \/>\n        DoEvents &#8216; UI\u3092\u66f4\u65b0<br \/>\n    Next i<\/p>\n<p>    &#8216; \u30d7\u30ed\u30b0\u30ec\u30b9\u30d0\u30fc\u3092\u30af\u30ea\u30a2<br \/>\n    Application.StatusBar = False<\/p>\n<p>    MsgBox &#8220;\u30b0\u30e9\u30d5\u306e\u66f4\u65b0\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002&#8221;, vbInformation<br \/>\nEnd Sub<br \/>\n&#8220;`<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u306f\u51e6\u7406\u306e\u9032\u884c\u72b6\u6cc1\u3092\u628a\u63e1\u3067\u304d\u3001\u9577\u6642\u9593\u306e\u66f4\u65b0\u4f5c\u696d\u4e2d\u3067\u3082\u30b9\u30c8\u30ec\u30b9\u3092\u8efd\u6e1b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Excel \u30de\u30af\u30ed\u3092\u6d3b\u7528\u3057\u305f\u52d5\u7684\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u30b0\u30e9\u30d5\u306f\u3001\u30c7\u30fc\u30bf\u53ef\u8996\u5316\u306e\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002\u9069\u5207\u306b\u8a2d\u8a08\u30fb\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3067\u3001\u30c7\u30fc\u30bf\u5206\u6790\u306e\u52b9\u7387\u3092\u5927\u5e45\u306b\u5411\u4e0a\u3055\u305b\u3001\u3088\u308a\u6df1\u3044\u6d1e\u5bdf\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Excel\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\u4eba\u304c\u3059\u3050\u306b\u8a66\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u30de\u30af\u30ed\u30b3\u30fc\u30c9 #8220;`vba Sub CreateInteractiveChart() Dim ws As Worksheet<\/p>\n","protected":false},"author":2,"featured_media":489,"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-490","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\/490","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=490"}],"version-history":[{"count":0,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts\/490\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/media\/489"}],"wp:attachment":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/media?parent=490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/categories?post=490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/tags?post=490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}