{"id":66,"date":"2020-08-13T15:41:23","date_gmt":"2020-08-13T06:41:23","guid":{"rendered":"http:\/\/yukihyo.conohawing.com\/?p=66"},"modified":"2020-08-13T16:40:48","modified_gmt":"2020-08-13T07:40:48","slug":"04_determination-of-a-holiday","status":"publish","type":"post","link":"http:\/\/yukihyo.conohawing.com\/?p=66","title":{"rendered":"04_determination of a holiday"},"content":{"rendered":"\n<p>today&#8217;s theme is holiday judgement by excell macro.<br><br>I think holiday doesn\u2019t have cycle.<br>some enterprises has a special holiday.<br>it is anniversary of founding, and so on.<\/p>\n\n\n\n<p>After some thought,<br>I decided coding holidays judgement per day.<br><br>bellow is macro statement of holiday judgement.<br><br>\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc<br>Dim D_num As Date<br>Dim myData(9) As String<br>Dim i As Integer<br><br>myData(0) = &#8220;&#8221;<br>myData(1) = #12\/30\/2020#<br>myData(2) = #12\/31\/2020#<br>myData(3) = &#8220;&#8221;<br>myData(4) = &#8220;&#8221;<br>myData(5) = &#8220;&#8221;<br>myData(6) = &#8220;New Year&#8217;s Holiday&#8221;<br>myData(7) = &#8220;New Year&#8217;s Holiday&#8221;<br>myData(8) = &#8220;&#8221;<br>myData(9) = &#8220;&#8221;<br><br>For i = LBound(myData) To UBound(myData)<br><br>Dim F_num As Long<br>For F_num = 1 To 10<br><br>D_num = CDate(Cells(F_num, 1))<br><span style=\"color:#0ca516\" class=\"has-inline-color\">\u2019assume that<\/span> <span style=\"color:#0ca516\" class=\"has-inline-color\">there are day of 10 cells from left corner to downward direction <\/span><br><span style=\"color:#0ca516\" class=\"has-inline-color\">\u2019and format of these cells is day form without asterisk. <\/span><br><span style=\"color:#0ca516\" class=\"has-inline-color\">\u2019(not *3\/14\/2012, but 2012\/3\/14)<\/span><\/p>\n\n\n\n<p>If InStr(myData(i), D_num) &lt;> 0 Then<br>Cells(F_num, 1).Font.ColorIndex = 46<br><span class=\"tadv-color\" style=\"color:#0071a1\"><span style=\"color:#0ca516\" class=\"has-inline-color\">\u2019if the cell matched holiday change<\/span><\/span> <span class=\"tadv-color\" style=\"color:#0071a1\"><span style=\"color:#0ca516\" class=\"has-inline-color\">the character color.  <\/span><\/span><br>Cells(F_num, 2) = myData(i + 5)<br><span class=\"tadv-color\" style=\"color:#0071a1\"><span style=\"color:#0ca516\" class=\"has-inline-color\">\u2019and writing holiday name next to this.<\/span><\/span><\/p>\n\n\n\n<p>Exit For<br>End If<br>Next F_num<br>Next i<br>\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc<br><br>i used one-dimensional matrix as two-dimensional<br>by IF sentence.<br><br>thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>today&#8217;s theme is holiday judgement by excell macro. I think holiday doesn\u2019t have cycle.some enterprises  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[9],"class_list":["post-66","post","type-post","status-publish","format-standard","hentry","category-excell-macro","tag-9"],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/yukihyo.conohawing.com\/index.php?rest_route=\/wp\/v2\/posts\/66","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/yukihyo.conohawing.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yukihyo.conohawing.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yukihyo.conohawing.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/yukihyo.conohawing.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=66"}],"version-history":[{"count":3,"href":"http:\/\/yukihyo.conohawing.com\/index.php?rest_route=\/wp\/v2\/posts\/66\/revisions"}],"predecessor-version":[{"id":69,"href":"http:\/\/yukihyo.conohawing.com\/index.php?rest_route=\/wp\/v2\/posts\/66\/revisions\/69"}],"wp:attachment":[{"href":"http:\/\/yukihyo.conohawing.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=66"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yukihyo.conohawing.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=66"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yukihyo.conohawing.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=66"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}