<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5317320757157807872</id><updated>2024-11-01T19:39:52.280+09:00</updated><category term="vba"/><category term="mysql"/><category term="linux"/><category term="excel"/><category term="罠"/><category term="sql"/><category term="javascript"/><category term="php"/><category term="ruby"/><category term="裏技"/><category term="rails"/><category term="error"/><category term="html"/><category term="csv"/><category term="エクセル関数"/><category term="android"/><category term="date"/><category term="google docs"/><category term="server"/><category term="正規表現"/><category term="雑"/><category term="IE"/><category term="apache"/><category term="css"/><category term="google apps"/><category term="pdf"/><category term="shell"/><category term="blogspot"/><category term="centos"/><category term="prince"/><category term="subversion"/><category term="フリーソフト"/><category term="api"/><category term="array"/><category term="datediff"/><category term="dos"/><category term="font"/><category term="formual"/><category term="gmail"/><category term="google spreadsheets"/><category term="grep"/><category term="jquery"/><category term="site search"/><category term="vmware"/><category term="エクセル"/><category term="ナイスサービス"/><category term="仮想環境"/><category term="自制ツール"/><category term="Eclips"/><category term="FormulaLocal"/><category term="R"/><category term="Scripting.Dictionary"/><category term="amchart"/><category term="ampps"/><category term="analytics"/><category term="blogger"/><category term="bp"/><category term="breakpoint"/><category term="bug"/><category term="cloud"/><category term="date_add"/><category term="debug"/><category term="duplicate"/><category term="esxi"/><category term="favicon"/><category term="ftp"/><category term="google api"/><category term="google apps engine"/><category term="google site"/><category term="google site search"/><category term="group by"/><category term="groupware"/><category term="gsuite"/><category term="hacking"/><category term="hardware"/><category term="insert"/><category term="jquerymobile"/><category term="lftp"/><category term="limit"/><category term="mail"/><category term="network"/><category term="odbc"/><category term="office"/><category term="openmeetings"/><category term="order by"/><category term="root"/><category term="round"/><category term="scroll"/><category term="ssd"/><category term="ssl"/><category term="svn"/><category term="userform"/><category term="vbs"/><category term="vlookup"/><category term="wifi"/><category term="xml"/><category term="お名前"/><category term="ゼロ非表示"/><category term="ブレークポイント"/><category term="メモ"/><category term="中断"/><category term="令和"/><category term="参照、数式、条件書式"/><category term="和暦"/><category term="地震"/><category term="年号変更"/><category term="数式"/><category term="映画"/><category term="書式"/><category term="月初"/><category term="月末"/><category term="月首"/><category term="条件付き書式"/><category term="絵"/><category term="金融"/><title type='text'>カゲンぱぱのイイカゲンメモ帳</title><subtitle type='html'>脳みそに入れたくないから、ここでメモ帳をしているだけ…</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>303</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-6964110587398654486</id><published>2020-02-18T18:04:00.000+09:00</published><updated>2020-02-18T18:04:20.400+09:00</updated><title type='text'>IE,Edgeで日本語ファイル名をダウンロードすると文字化けしてしまう対策</title><content type='html'>header(&#39;Content-Disposition: attachment; filename*=UTF-8\&#39;\&#39;&#39;.rawurlencode($filename));</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/6964110587398654486/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2020/02/ieedge.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/6964110587398654486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/6964110587398654486'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2020/02/ieedge.html' title='IE,Edgeで日本語ファイル名をダウンロードすると文字化けしてしまう対策'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-692541285276645801</id><published>2019-10-04T14:56:00.001+09:00</published><updated>2019-10-04T14:57:52.369+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><category scheme="http://www.blogger.com/atom/ns#" term="hacking"/><category scheme="http://www.blogger.com/atom/ns#" term="vba"/><category scheme="http://www.blogger.com/atom/ns#" term="裏技"/><title type='text'>シート保護掛けたが、パスワードを忘れてしまいました？ハッキング方法</title><content type='html'>下記のソースコードを解除したいシートにコピーして、実行するだけ…&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;Sub PasswordBreaker()
Dim i As Integer, j As Integer, k As Integer
Dim l As Integer, m As Integer, n As Integer
Dim i1 As Integer, i2 As Integer, i3 As Integer
Dim i4 As Integer, i5 As Integer, i6 As Integer
On Error Resume Next
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
ActiveSheet.Unprotect Chr(i) &amp; Chr(j) &amp; Chr(k) &amp; _
Chr(l) &amp; Chr(m) &amp; Chr(i1) &amp; Chr(i2) &amp; Chr(i3) &amp; _
Chr(i4) &amp; Chr(i5) &amp; Chr(i6) &amp; Chr(n)
If ActiveSheet.ProtectContents = False Then
MsgBox &quot;One usable password is &quot; &amp; Chr(i) &amp; Chr(j) &amp; _
Chr(k) &amp; Chr(l) &amp; Chr(m) &amp; Chr(i1) &amp; Chr(i2) &amp; _
Chr(i3) &amp; Chr(i4) &amp; Chr(i5) &amp; Chr(i6) &amp; Chr(n)
Exit Sub
End If
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
End Sub
&lt;/pre&gt;&lt;a href=&quot;https://www.excelsupersite.com/how-to-unprotect-an-excel-spreadsheet-if-you-have-lost-your-password/&quot;&gt;ここ&lt;/a&gt;参照&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/692541285276645801/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2019/10/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/692541285276645801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/692541285276645801'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2019/10/blog-post.html' title='シート保護掛けたが、パスワードを忘れてしまいました？ハッキング方法'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-1749023187952042084</id><published>2019-10-01T17:28:00.003+09:00</published><updated>2019-10-01T17:30:12.047+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="date"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>javascriptで月末日を求める</title><content type='html'>12+1=13になるけど、そこも問題ないみたい、0が1月らしい&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
var n = new Date(&#39;2019-12-01&#39;)&lt;br /&gt;
var m = new Date(n.getFullYear(),n.getMonth()+1,0);&lt;br /&gt;
console.log(m);&lt;br /&gt;
&lt;br /&gt;
&gt; Tue Dec 31 2019 00:00:00 GMT+0900 (日本標準時)&lt;br /&gt;
&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/1749023187952042084/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2019/10/javascript.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/1749023187952042084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/1749023187952042084'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2019/10/javascript.html' title='javascriptで月末日を求める'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-6707526478997133742</id><published>2019-07-10T15:39:00.002+09:00</published><updated>2019-07-10T15:39:44.369+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="date"/><category scheme="http://www.blogger.com/atom/ns#" term="date_add"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><title type='text'>sql DATE_ADD</title><content type='html'>select DATE_ADD(&#39;2019-01-31&#39;, INTERVAL + 1 MONTH);&lt;br /&gt;
2019-02-28&lt;br /&gt;
&lt;br /&gt;
select DATE_ADD(&#39;2019-01-30&#39;, INTERVAL + 1 MONTH);&lt;br /&gt;
2019-02-28&lt;br /&gt;
&lt;br /&gt;
select DATE_ADD(&#39;2019-01-29&#39;, INTERVAL + 1 MONTH);&lt;br /&gt;
2019-02-28&lt;br /&gt;
&lt;br /&gt;
select DATE_ADD(&#39;2019-01-28&#39;, INTERVAL + 1 MONTH);&lt;br /&gt;
2019-02-28&lt;br /&gt;
&lt;br /&gt;
select DATE_ADD(&#39;2019-01-27&#39;, INTERVAL + 1 MONTH);&lt;br /&gt;
2019-02-27&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/6707526478997133742/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2019/07/sql-dateadd.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/6707526478997133742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/6707526478997133742'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2019/07/sql-dateadd.html' title='sql DATE_ADD'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-7795425048517928892</id><published>2019-07-02T22:31:00.000+09:00</published><updated>2019-07-02T22:31:55.834+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="root"/><title type='text'>えっへん！</title><content type='html'>&lt;code&gt;&lt;br /&gt;
GRANT ALL PRIVILEGES ON *.* TO &#39;root&#39;@&#39;%&#39; IDENTIFIED BY &#39;password&#39;;&lt;br /&gt;
&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/7795425048517928892/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2019/07/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/7795425048517928892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/7795425048517928892'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2019/07/blog-post.html' title='えっへん！'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-5927432961219550076</id><published>2019-07-02T18:29:00.001+09:00</published><updated>2019-07-02T18:29:54.391+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="formual"/><category scheme="http://www.blogger.com/atom/ns#" term="FormulaLocal"/><category scheme="http://www.blogger.com/atom/ns#" term="vba"/><title type='text'>左に列の合計,FormulaLocalの書き方</title><content type='html'>&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;cl.Offset(0, 3).FormulaLocal = &quot;=SUM(RC[-2],RC[-1])&quot;
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/5927432961219550076/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2019/07/formulalocal.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/5927432961219550076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/5927432961219550076'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2019/07/formulalocal.html' title='左に列の合計,FormulaLocalの書き方'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-2210742560456436791</id><published>2019-07-01T18:14:00.001+09:00</published><updated>2019-07-01T18:16:52.176+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><category scheme="http://www.blogger.com/atom/ns#" term="vba"/><category scheme="http://www.blogger.com/atom/ns#" term="vlookup"/><category scheme="http://www.blogger.com/atom/ns#" term="エクセル関数"/><title type='text'>vlookupではできない、範囲指定のカスタマイズ関数</title><content type='html'>&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;Function vlookups(val As Range, min As Range, max As Range, col As Range) As String
Dim cl As Range
For Each cl In min
    If val.Value &gt;= cl.Value And val.Value &lt;= cl.Worksheet.Cells(cl.Row, max.Column) Then
        vlookups = cl.Worksheet.Cells(cl.Row, col.Column)
        Exit For
    End If
Next
End Function
&lt;/pre&gt;
使い方：
&lt;code&gt;
=vlookups(E4,$A$1:$A$4,$B$1:$B$4,$C$1:$C$4)
&lt;/code&gt;

結果：
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKvdjYJCgaKjPH2eQrQL48FOCgkCv2KRCoySX2ln1XAyJR5_FKKOCj5MRAbWteclMM9K4Img1ZYjTMEBnwBBt39GhTereVMn3ItFm_E4TjhaK4OBsFhNrKbnOSyLg-tF8rXbD_mhzy-TA/s1600/2019-07-01+18-13-36.jpg&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKvdjYJCgaKjPH2eQrQL48FOCgkCv2KRCoySX2ln1XAyJR5_FKKOCj5MRAbWteclMM9K4Img1ZYjTMEBnwBBt39GhTereVMn3ItFm_E4TjhaK4OBsFhNrKbnOSyLg-tF8rXbD_mhzy-TA/s320/2019-07-01+18-13-36.jpg&quot; width=&quot;320&quot; height=&quot;88&quot; data-original-width=&quot;456&quot; data-original-height=&quot;126&quot; /&gt;&lt;/a&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/2210742560456436791/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2019/07/vlookup.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/2210742560456436791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/2210742560456436791'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2019/07/vlookup.html' title='vlookupではできない、範囲指定のカスタマイズ関数'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKvdjYJCgaKjPH2eQrQL48FOCgkCv2KRCoySX2ln1XAyJR5_FKKOCj5MRAbWteclMM9K4Img1ZYjTMEBnwBBt39GhTereVMn3ItFm_E4TjhaK4OBsFhNrKbnOSyLg-tF8rXbD_mhzy-TA/s72-c/2019-07-01+18-13-36.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-6684199272140976057</id><published>2019-05-24T10:16:00.001+09:00</published><updated>2019-05-24T10:18:26.223+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bug"/><category scheme="http://www.blogger.com/atom/ns#" term="gmail"/><category scheme="http://www.blogger.com/atom/ns#" term="gsuite"/><category scheme="http://www.blogger.com/atom/ns#" term="裏技"/><title type='text'>G Suiteのバグ？仕様？</title><content type='html'>G Suiteのバグ？仕様？&lt;br /&gt;
Steps:&lt;br /&gt;
1.グループメールabc@xxx.comを作成&lt;br /&gt;
2.xyz@xxx.comの個人メールのGmail設定から、「アカウント追加」して、abc@xxx.comから送信できるように登録&lt;br /&gt;
3.グループメールabc@xxx.comを削除&lt;br /&gt;
4.アカウントabc@xxx.comを作成します&lt;br /&gt;
結果：&lt;br /&gt;
xyz@xxx.comがabc@xxx.comのパスワードを知らなくでも、abc@xxx.comが送信者として送信できる。&lt;br /&gt;
但しabc@xxx.comアカウントの送信済みには残りません。&lt;br /&gt;
abc@xxx.comの受信もxyz@xxx.comの受信されません。&lt;br /&gt;
&lt;br /&gt;
ややこしいけど、これは仕様ですかバグですか？</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/6684199272140976057/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2019/05/g-suite-steps-1.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/6684199272140976057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/6684199272140976057'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2019/05/g-suite-steps-1.html' title='G Suiteのバグ？仕様？'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-1246915979346313761</id><published>2019-05-10T16:02:00.001+09:00</published><updated>2019-05-10T16:06:07.322+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><category scheme="http://www.blogger.com/atom/ns#" term="vba"/><category scheme="http://www.blogger.com/atom/ns#" term="エクセル関数"/><category scheme="http://www.blogger.com/atom/ns#" term="正規表現"/><title type='text'>令和数式を置換してくれる自作関数</title><content type='html'>ポイントは正規表現のReplaceで、パターン化して一致されたセルの番地を更にReplaceに使ったこと。「$1」を使って一個目のマッチングを引用すること。&lt;br /&gt;
&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;Option Explicit
Public Const REIWA = &quot;IF(_CELL_&gt;=DATE(2019,5,1),&quot;&quot;令和&quot;&quot;&amp;IF(YEAR(_CELL_)-2018=1,&quot;&quot;元&quot;&quot;,YEAR(_CELL_)-2018)&amp;&quot;&quot;年&quot;&quot;&amp;MONTH(_CELL_)&amp;&quot;&quot;月&quot;&quot;&amp;DAY(_CELL_)&amp;&quot;&quot;日&quot;&quot;,TEXT(_CELL_,&quot;&quot;ggge年m月d日&quot;&quot;))&quot;
Function reiwa_switch(strFormual, strCellAddr As String) As String

Dim reg As Object
Set reg = CreateObject(&quot;VBScript.RegExp&quot;)
With reg
    .Pattern = &quot;TEXT\((&quot; &amp; strCellAddr &amp; &quot;),&quot;&quot;ggge年m月d日&quot;&quot;\)&quot;
    .IgnoreCase = False
    .Global = True
End With
reiwa_switch = reg.Replace(strFormual, Replace(REIWA, &quot;_CELL_&quot;, &quot;$1&quot;))
End Function
&lt;/pre&gt;&lt;code&gt;&lt;br /&gt;
=reiwa_switch(A1,A2)→関数&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TEXT(data!FU3,&quot;ggge年m月d日&quot;)→第一引数（A1）&lt;br /&gt;
data!FU3→第二引数（A2）&lt;br /&gt;
IF(data!FU3&gt;=DATE(2019,5,1),&quot;令和&quot;&amp;IF(YEAR(data!FU3)-2018=1,&quot;元&quot;,YEAR(data!FU3)-2018)&amp;&quot;年&quot;&amp;MONTH(data!FU3)&amp;&quot;月&quot;&amp;DAY(data!FU3)&amp;&quot;日&quot;,TEXT(data!FU3,&quot;ggge年m月d日&quot;))→結果&lt;br /&gt;
&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/1246915979346313761/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2019/05/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/1246915979346313761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/1246915979346313761'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2019/05/blog-post.html' title='令和数式を置換してくれる自作関数'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-8767613334442339631</id><published>2019-04-03T14:54:00.000+09:00</published><updated>2019-04-05T13:19:15.303+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><category scheme="http://www.blogger.com/atom/ns#" term="エクセル"/><category scheme="http://www.blogger.com/atom/ns#" term="令和"/><category scheme="http://www.blogger.com/atom/ns#" term="和暦"/><category scheme="http://www.blogger.com/atom/ns#" term="年号変更"/><category scheme="http://www.blogger.com/atom/ns#" term="数式"/><title type='text'>【新年号】令和元年、エクセル数式での対応方法</title><content type='html'>&lt;code&gt;&lt;br /&gt;
=IF(D1&gt;=DATE(2019,5,1),&quot;令和&quot;&amp;IF(YEAR(D1)-2018=1,&quot;元&quot;,YEAR(D1)-2018)&amp;&quot;年&quot;&amp;MONTH(D1)&amp;&quot;月&quot;&amp;DAY(D1)&amp;&quot;日&quot;,TEXT(D1,&quot;ggge年m月d日&quot;))&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
※数式の中の「D1」は実際日付が書いてあるセルです、そこは適当に変更してください。&lt;br /&gt;
※「令和元年」ではなく「令和1年」として表示したければ、「IF(YEAR(D1)-2018=1,&quot;元&quot;,」を削除し、「-2018)&amp;&quot;年&quot;」の中の「)」も削除すればOK&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFgeWiAvV67dzBUlCVYplAEMsbGULOxcNsuklKPAmEmz1l0mOmneWGiCwdE1Aad5i99BxWcQzLU9429CbNB19WGhvTLaMi_yITFEeEVBjz_gy0dDCVVzdpm2juFClqCH3hFuzT02WNSEo/s1600/2019-04-05+9-51-54.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFgeWiAvV67dzBUlCVYplAEMsbGULOxcNsuklKPAmEmz1l0mOmneWGiCwdE1Aad5i99BxWcQzLU9429CbNB19WGhvTLaMi_yITFEeEVBjz_gy0dDCVVzdpm2juFClqCH3hFuzT02WNSEo/s320/2019-04-05+9-51-54.png&quot; width=&quot;320&quot; height=&quot;291&quot; data-original-width=&quot;324&quot; data-original-height=&quot;295&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/8767613334442339631/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2019/04/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/8767613334442339631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/8767613334442339631'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2019/04/blog-post.html' title='【新年号】令和元年、エクセル数式での対応方法'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFgeWiAvV67dzBUlCVYplAEMsbGULOxcNsuklKPAmEmz1l0mOmneWGiCwdE1Aad5i99BxWcQzLU9429CbNB19WGhvTLaMi_yITFEeEVBjz_gy0dDCVVzdpm2juFClqCH3hFuzT02WNSEo/s72-c/2019-04-05+9-51-54.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-7703704532082177633</id><published>2019-03-29T17:22:00.000+09:00</published><updated>2019-04-01T17:41:06.763+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="array"/><category scheme="http://www.blogger.com/atom/ns#" term="csv"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>PHPでCSVを読み込んで、Arrayに変換するメソッド、最初の行を横方向連想配列のキーとするや、縦方向のid列を指定するや、一部の列のみ抽出するとか、機能盛りだくさん</title><content type='html'>&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;/* $csvPath: CSV file path
  * $firstRowAsKey: whether make the first row as key horizontally. or just number, duplicate will not be over writed
  * $columnAsKey: whether to set key(column name or column index) column vertically. or just number, duplicate will not be over writed
  * $columnAsVal: Array or Single Column name or column index from 0, whether to filte columns
  * $smartFlat:if horizontally array only have one key, then falt it.
  *
  * For Example: CSV(this methord will take care of sjis utf8 encode problem)
  * name,point
  * Joe,2
  * Peter,321
  * Jane,34
  *
  * $firstRowAsKey = true, $columnAsKey = null, $columnsAsVal = null
  * Array([0] =&amp;gt; Array([name] =&amp;gt; Joe, [point] =&amp;gt; 2), [1] =&amp;gt; Array([name] =&amp;gt; Peter,[point] =&amp;gt; 321), [2] =&amp;gt; Array([name] =&amp;gt; Jane, [point] =&amp;gt; 34))
  *
  * firstRowAsKey = false, $columnAsKey = 0, $columnsAsVal = null
  * Array([name] =&amp;gt; Array([0] =&amp;gt; name, [1] =&amp;gt; point), [Joe] =&amp;gt; Array([0] =&amp;gt; Joe, [1] =&amp;gt; 2), [Peter] =&amp;gt; Array([0] =&amp;gt; Peter, [1] =&amp;gt; 321), [Jane] =&amp;gt; Array([0] =&amp;gt; Jane, [1] =&amp;gt; 34))
  *
  * firstRowAsKey = true, $columnAsKey = &amp;#039;name&amp;#039;, $columnsAsVal = point
  * Array([Joe] =&amp;gt; Array([point] =&amp;gt; 2), [Peter] =&amp;gt; Array([point] =&amp;gt; 321), [Jane] =&amp;gt; Array([point] =&amp;gt; 34))
  */
 function readArrayCSV($csvPath, $firstRowAsKey = true, $columnAsKey = null, $columnsAsVal = null, $smartFlat = true) {
  $sjis = file_get_contents($csvPath);
  $utf8 = mb_convert_encoding($sjis, &#39;UTF-8&#39;, &#39;SJIS-win&#39;);
  $temp = tempnam(sys_get_temp_dir(), &#39;TMP_&#39;);
  file_put_contents($temp, $utf8);
  $csv = file($temp, FILE_IGNORE_NEW_LINES);

  if ($firstRowAsKey) {
   $titles = explode(&amp;quot;,&amp;quot;, array_shift($csv));
   $csv = array_map(&amp;#039;str_getcsv&amp;#039;, $csv);
   $csv = array_map(function ($row) use ($titles) {
       return array_combine($titles, $row);
   },$csv);
  } else {
   $csv = array_map(&amp;#039;str_getcsv&amp;#039;, $csv);
  }

  if ($columnAsKey !== null) {
   $result = array();
   if (is_int($columnAsKey) &amp;amp;&amp;amp; $columnAsKey &amp;gt; 0) $columnAsKey--;
   foreach ($csv as $row) {
    if (isset($row[$columnAsKey])) {
     $row_filtered = $row;
     if ($columnsAsVal !== null) {
      $row_filtered = array_intersect_key($row, array_flip((array)$columnsAsVal));
     }
     $result[$row[$columnAsKey]] = ($smartFlat?(count($row_filtered) == 1?array_shift(array_values($row_filtered)):$row_filtered):$row_filtered);
    }
   }

  } else {
   $result = $csv;
  }
  return $result;
 }
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/7703704532082177633/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2019/03/phpcsvarrayid.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/7703704532082177633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/7703704532082177633'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2019/03/phpcsvarrayid.html' title='PHPでCSVを読み込んで、Arrayに変換するメソッド、最初の行を横方向連想配列のキーとするや、縦方向のid列を指定するや、一部の列のみ抽出するとか、機能盛りだくさん'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-558442448733629370</id><published>2019-03-25T15:20:00.000+09:00</published><updated>2019-03-25T15:20:10.178+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="group by"/><category scheme="http://www.blogger.com/atom/ns#" term="limit"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="order by"/><title type='text'>mysql グループ毎、最初のレコードを取得 Select first recorder in every group</title><content type='html'>方法１：&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
SELECT * FROM &lt;br /&gt;
(&lt;br /&gt;
 SELECT * FROM `table`&lt;br /&gt;
 ORDER BY AnotherColumn&lt;br /&gt;
) t1&lt;br /&gt;
GROUP BY SomeColumn&lt;br /&gt;
;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
方法２：&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
SELECT somecolumn, anothercolumn &lt;br /&gt;
  FROM sometable &lt;br /&gt;
 WHERE id IN (&lt;br /&gt;
               SELECT min(id) &lt;br /&gt;
                 FROM sometable &lt;br /&gt;
                GROUP BY somecolumn&lt;br /&gt;
             );&lt;br /&gt;
&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/558442448733629370/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2019/03/mysql-select-first-recorder-in-every.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/558442448733629370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/558442448733629370'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2019/03/mysql-select-first-recorder-in-every.html' title='mysql グループ毎、最初のレコードを取得 Select first recorder in every group'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-5237345128566114323</id><published>2018-08-02T16:44:00.001+09:00</published><updated>2018-08-02T16:46:12.510+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="pdf"/><category scheme="http://www.blogger.com/atom/ns#" term="vba"/><category scheme="http://www.blogger.com/atom/ns#" term="vbs"/><title type='text'>複数PDFを一括印刷する、PDF毎の一枚目は飛ばす。ドラッグアンドドロップ</title><content type='html'>&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&#39;//Bath Print multiple pdfs without the first page
&#39;//複数PDFを一括印刷する、PDF毎の一枚目は飛ばす。ドラッグアンドドロップでできます

set WshShell = CreateObject (&quot;Wscript.Shell&quot;)
set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set objArgs = WScript.Arguments

if objArgs.Count &amp;lt; 1 then
msgbox(&quot;Please drag a file on the script&quot;)
WScript.quit
end if

Set gApp = CreateObject(&quot;AcroExch.App&quot;)
gApp.show &#39;&lt;- br=&quot;&quot; comment=&quot;&quot; hidden=&quot;&quot; in=&quot;&quot; mod=&quot;&quot; or=&quot;&quot; out=&quot;&quot; take=&quot;&quot; to=&quot;&quot; work=&quot;&quot;&gt; 

&#39;open via Avdoc and print
for i=0 to objArgs.Count - 1
FileIn = ObjArgs(i)
Set AVDoc = CreateObject(&quot;AcroExch.AVDoc&quot;)
If AVDoc.Open(FileIn, &quot;&quot;) Then
Set PDDoc = AVDoc.GetPDDoc()
Set JSO = PDDoc.GetJSObject
x = PDDoc.GetNumPages
jso.print false, 1, x-1, true
gApp.CloseAllDocs
end if
next

gApp.hide : gApp.exit : Quit()
MsgBox &quot;Done!&quot;

Sub Quit
Set JSO = Nothing : Set PDDoc = Nothing : Set gApp =Nothing : Wscript.quit
End Sub
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/5237345128566114323/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2018/08/pdfpdf.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/5237345128566114323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/5237345128566114323'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2018/08/pdfpdf.html' title='複数PDFを一括印刷する、PDF毎の一枚目は飛ばす。ドラッグアンドドロップ'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-811850586930969986</id><published>2018-06-29T11:25:00.000+09:00</published><updated>2018-06-29T11:25:29.962+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="date"/><category scheme="http://www.blogger.com/atom/ns#" term="datediff"/><category scheme="http://www.blogger.com/atom/ns#" term="vba"/><category scheme="http://www.blogger.com/atom/ns#" term="罠"/><title type='text'>同じ時刻じゃないの？！！という罠</title><content type='html'>&lt;code&gt;&lt;br /&gt;
?cdate(&quot;2014/01/02 16:05:00&quot;) = dateadd(&quot;n&quot;,5,cdate(&quot;2014/01/02 16:00:00&quot;))&lt;br /&gt;
False&lt;br /&gt;
?cdate(&quot;2014/01/02 16:05:00&quot;) - dateadd(&quot;n&quot;,5,cdate(&quot;2014/01/02 16:00:00&quot;))&lt;br /&gt;
7.27595761418343E-12 &lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
おかしいでしょう！ 16:05:00は16:00:00に5分足すじゃない！&lt;br /&gt;
参考ここ：&lt;br /&gt;
https://www.reddit.com/r/vba/comments/5mdnpb/pic_of_my_data_mismatch_problem/&lt;br /&gt;
http://www.fmsinc.com/tpapers/math/index.html&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
DateDiff(&quot;s&quot;, cdate(&quot;2014/01/02 16:05:00&quot;), dateadd(&quot;n&quot;,5,cdate(&quot;2014/01/02 16:00:00&quot;))) = 0&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/811850586930969986/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2018/06/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/811850586930969986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/811850586930969986'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2018/06/blog-post.html' title='同じ時刻じゃないの？！！という罠'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-6538851419180113520</id><published>2018-01-23T18:06:00.001+09:00</published><updated>2018-03-01T16:59:12.154+09:00</updated><title type='text'>薄い原稿をスキャンするときのコツ</title><content type='html'>薄い原稿をスキャンするときのコツ&lt;br /&gt;
１．DPIを最高に&lt;br /&gt;
２．濃度を最高に&lt;br /&gt;
３．黒白2色にする&lt;br /&gt;
４．シャープネスを最高に&lt;br /&gt;
５．コントラストを最高に&lt;br /&gt;
↓&lt;br /&gt;
スキャン&lt;br /&gt;
↓&lt;br /&gt;
画像処理ソフトで：フィルター（ノイズ除去3%）実施&lt;br /&gt;
↓&lt;br /&gt;
終わり&lt;br /&gt;
&lt;br /&gt;
※画像になるようにスキャナーを設定する場合、Tiffしか選べない機械があります。&lt;br /&gt;
Tiff画像にした場合、複数枚スキャン図が一つのTiffファイルなります。&lt;br /&gt;
print to snagit editorなどを活用して、一旦snagitに変換して、excelやwordなどに&lt;br /&gt;
コピー貼り付けして使う。</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/6538851419180113520/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2018/01/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/6538851419180113520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/6538851419180113520'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2018/01/blog-post.html' title='薄い原稿をスキャンするときのコツ'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-5562851602591925826</id><published>2018-01-09T09:42:00.000+09:00</published><updated>2018-01-09T10:49:18.722+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="server"/><title type='text'>DBバックアップスクリプト</title><content type='html'>backup_mydb.sh、※「--ignore-table」は一部のテーブルを除外するときに使う&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
dirpath=&#39;/home/admin/mydb_dump/dump&#39;&lt;br /&gt;
filename=`date +%Y%m%d`&lt;br /&gt;
mysqldump -uDB_USER -pDB_PASSWORD DB_NAME --ignore-table=mydb.table1 --ignore-table=mydb.table2 &gt; $dirpath/mydb_$filename.dump&lt;br /&gt;
chmod 700 $dirpath/mydb_$filename.dump&lt;br /&gt;
tar cpzvf $dirpath/mydb_$filename.dump.tar.gz $dirpath/mydb_$filename.dump&lt;br /&gt;
rm -f $dirpath/mydb_$filename.dump&lt;br /&gt;
find $dirpath/mydb_????????.dump.tar.gz -type f -mtime +365 -ls -exec rm -f -- {} \;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
実行権限を付けます&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
chmod +x backup_mydb_db.sh&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
そしてcron設定、毎月１日零時10分くらいバックアップを取る＋一年前のバックアップを削除&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
crontab -e&lt;br /&gt;
10 0 1 * * /home/admin/mydb_dump/backup_mydb.sh&lt;br /&gt;
&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/5562851602591925826/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2018/01/db.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/5562851602591925826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/5562851602591925826'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2018/01/db.html' title='DBバックアップスクリプト'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-3127468143208150681</id><published>2017-09-22T14:27:00.001+09:00</published><updated>2017-09-22T14:27:06.203+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><category scheme="http://www.blogger.com/atom/ns#" term="formual"/><title type='text'>文字列の数字をサマリー Sum string number</title><content type='html'>数字なんだけど、文字列として表示せざるを得ない場合もある。その場合、この一列の数字を「SUM」するとうまくいかない場合があるみたい。AB4:AB100をサマリーする場合、&lt;br /&gt;
ソリューションとして「=VALUE(AB4)」の補助列を追加することは考えられますが、「=SUMPRODUCT(AB4:AB100 *1)」という方法もできるみたいです。</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/3127468143208150681/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2017/09/sum-string-number.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/3127468143208150681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/3127468143208150681'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2017/09/sum-string-number.html' title='文字列の数字をサマリー Sum string number'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-8459008904335151876</id><published>2017-09-07T17:47:00.000+09:00</published><updated>2017-09-07T17:47:06.665+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="error"/><category scheme="http://www.blogger.com/atom/ns#" term="vba"/><category scheme="http://www.blogger.com/atom/ns#" term="罠"/><title type='text'>「_xlfn.IFERROR」という #NAME?エラー見えない「名前定義」にエラーがあった場合</title><content type='html'>下記の王なメソッドを作って、一旦エラーになっている名前定義を見える化にして、そして「名前」一覧から手動で削除して、ブックを保存&lt;br /&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;Sub delErrNames()
Dim n As name
Dim bk As Workbook
Set bk = ThisWorkbook

For Each n In bk.Names
    If n.RefersTo = &quot;=#NAME?&quot; Then
      n.Visible = True
    End If
Next
End Sub
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/8459008904335151876/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2017/09/xlfniferror-name.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/8459008904335151876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/8459008904335151876'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2017/09/xlfniferror-name.html' title='「_xlfn.IFERROR」という #NAME?エラー見えない「名前定義」にエラーがあった場合'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-7892118362615571374</id><published>2017-06-15T18:01:00.001+09:00</published><updated>2017-06-15T18:04:44.924+09:00</updated><title type='text'>Google APIを利用して、PHPで２つの住所の距離と所要時間を取得する</title><content type='html'>Google APIを利用して、PHPで２つの住所の距離と所要時間を取得するサンプル※車での移動距離と所要時間&lt;br /&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;&lt;?php
function get_coordinates($address)
{
    $address = urlencode($address);
    $url = &quot;http://maps.google.com/maps/api/geocode/json?address=$address&amp;sensor=false&amp;region=Poland&quot;;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_PROXYPORT, 3128);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    $response = curl_exec($ch);
    curl_close($ch);
    $response_a = json_decode($response);
    $status = $response_a-&gt;status;

    if ( $status == &#39;ZERO_RESULTS&#39; )
    {
        return FALSE;
    }
    else
    {
        $return = array(&#39;lat&#39; =&gt; $response_a-&gt;results[0]-&gt;geometry-&gt;location-&gt;lat, &#39;long&#39; =&gt; $long = $response_a-&gt;results[0]-&gt;geometry-&gt;location-&gt;lng);
        return $return;
    }
}

function GetDrivingDistance($lat1, $lat2, $long1, $long2)
{
    $url = &quot;https://maps.googleapis.com/maps/api/distancematrix/json?origins=&quot;.$lat1.&quot;,&quot;.$long1.&quot;&amp;destinations=&quot;.$lat2.&quot;,&quot;.$long2.&quot;&amp;mode=driving&amp;language=pl-PL&quot;;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_PROXYPORT, 3128);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    $response = curl_exec($ch);
    curl_close($ch);
    $response_a = json_decode($response, true);
    $dist = $response_a[&#39;rows&#39;][0][&#39;elements&#39;][0][&#39;distance&#39;][&#39;text&#39;];
    $time = $response_a[&#39;rows&#39;][0][&#39;elements&#39;][0][&#39;duration&#39;][&#39;text&#39;];

    return array(&#39;distance&#39; =&gt; $dist, &#39;time&#39; =&gt; $time);
}
//Usage:

$coordinates1 = get_coordinates(&#39;東京都三鷹市上連雀8丁目3番3号&#39;);
$coordinates2 = get_coordinates(&#39;東京都千代田区富士見2-4-1&#39;);
if ( !$coordinates1 || !$coordinates2 )
{
    echo &#39;Bad address.&#39;;
}
else
{
    $dist = GetDrivingDistance($coordinates1[&#39;lat&#39;], $coordinates2[&#39;lat&#39;], $coordinates1[&#39;long&#39;], $coordinates2[&#39;long&#39;]);
    echo &#39;Distance: &lt;b&gt;&#39;.$dist[&#39;distance&#39;].&#39;&lt;/b&gt;
Travel time duration: &lt;b&gt;&#39;.$dist[&#39;time&#39;].&#39;&lt;/b&gt;&#39;;
}
&lt;/pre&gt;こんな風に結果が表示されます：&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
Distance: 22,3 km&lt;br /&gt;
Travel time duration: 40 min&lt;br /&gt;
&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/7892118362615571374/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2017/06/google-apiphp.html#comment-form' title='1 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/7892118362615571374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/7892118362615571374'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2017/06/google-apiphp.html' title='Google APIを利用して、PHPで２つの住所の距離と所要時間を取得する'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-4566418931186265681</id><published>2017-06-09T10:07:00.002+09:00</published><updated>2020-04-28T17:21:30.591+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="debug"/><category scheme="http://www.blogger.com/atom/ns#" term="vba"/><category scheme="http://www.blogger.com/atom/ns#" term="罠"/><title type='text'>GHOST BREAKPOINT,VBA ブレークポイント設置してないのに、急にいちいち止まるようになる件</title><content type='html'>解決方法&lt;br /&gt;
１．Debugに入って（そもそも止まらないなら、とりあえずなんかのsubを作成して、PBを置いて止める）&lt;br /&gt;
２．Ctrl+Pauseを2回押す&lt;br /&gt;
３．Playで継続&lt;br /&gt;
４．保存</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/4566418931186265681/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2017/06/ghost-breakpointvba.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/4566418931186265681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/4566418931186265681'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2017/06/ghost-breakpointvba.html' title='GHOST BREAKPOINT,VBA ブレークポイント設置してないのに、急にいちいち止まるようになる件'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-6300945621962663160</id><published>2017-04-27T10:41:00.001+09:00</published><updated>2017-04-27T10:41:13.481+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="vba"/><category scheme="http://www.blogger.com/atom/ns#" term="エクセル関数"/><title type='text'>PHONETIC関数が効かない時</title><content type='html'>PHONETICという漢字をカタカナに変換してくれる関数があります。しかし何故か変換せれず漢字のまま出力されてしまう時があります。&lt;br /&gt;
その時は、マクロのチカラを借りる。&lt;br /&gt;
例えば漢字の列がA列の場合：&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
    Range(&quot;A:A&quot;).SetPhonetic&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
実行後、隣の列で「=PHONETIC(&quot;A1&quot;)」で数式を入れると変換されます&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/6300945621962663160/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2017/04/phonetic.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/6300945621962663160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/6300945621962663160'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2017/04/phonetic.html' title='PHONETIC関数が効かない時'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-2589643491996258589</id><published>2017-03-30T17:30:00.001+09:00</published><updated>2017-03-30T17:30:21.982+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="duplicate"/><category scheme="http://www.blogger.com/atom/ns#" term="insert"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><title type='text'>INSERT INTO 複数VALUES時のON DUPLICATE KEY UPDATEの書き方</title><content type='html'>&lt;pre class=&quot;sql&quot; name=&quot;code&quot;&gt;CREATE TABLE table_a (
  a INT NOT NULL,
  b INT NOT NULL,
  c INT NOT NULL,
  UNIQUE (a, b)
);

INSERT INTO table_a (a, b, c) VALUES (1, 2, 0),(3, 4, 5) ON DUPLICATE KEY UPDATE c = VALUES(c);

&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/2589643491996258589/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2017/03/insert-into-valueson-duplicate-key.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/2589643491996258589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/2589643491996258589'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2017/03/insert-into-valueson-duplicate-key.html' title='INSERT INTO 複数VALUES時のON DUPLICATE KEY UPDATEの書き方'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-2824471935070439593</id><published>2017-03-30T17:25:00.001+09:00</published><updated>2017-03-30T17:25:44.326+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="scroll"/><category scheme="http://www.blogger.com/atom/ns#" term="userform"/><category scheme="http://www.blogger.com/atom/ns#" term="vba"/><title type='text'>ListBoxがマウスのスクロール対応していない？！</title><content type='html'>やってみたら本当だ。&lt;br /&gt;
幸いソリューションは既にありました。ありがとうございます。&lt;br /&gt;
参照：　https://social.msdn.microsoft.com/Forums/en-US/7d584120-a929-4e7c-9ec2-9998ac639bea/mouse-scroll-in-userform-listbox-in-excel-2010?forum=isvvba&lt;br /&gt;
&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;Private Sub ListBox1_MouseMove( _
             ByVal Button As Integer, ByVal Shift As Integer, _
             ByVal x As Single, ByVal y As Single)
&#39; start tthe hook
     HookListBoxScroll
End Sub

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
     UnhookListBoxScroll
End Sub
&#39;&#39;&#39;&#39;&#39;&#39;&#39; end Userform code

&#39;&#39;&#39;&#39;&#39;&#39;&#39; normal module code
Option Explicit

Private Type POINTAPI
     x As Long
     y As Long
End Type

Private Type MOUSEHOOKSTRUCT
     pt As POINTAPI
     hwnd As Long
     wHitTestCode As Long
     dwExtraInfo As Long
End Type

Private Declare Function FindWindow Lib &quot;user32&quot; _
                     Alias &quot;FindWindowA&quot; ( _
                             ByVal lpClassName As String, _
                             ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib &quot;user32.dll&quot; _
                     Alias &quot;GetWindowLongA&quot; ( _
                             ByVal hwnd As Long, _
                             ByVal nIndex As Long) As Long

Private Declare Function SetWindowsHookEx Lib &quot;user32&quot; _
                     Alias &quot;SetWindowsHookExA&quot; ( _
                             ByVal idHook As Long, _
                             ByVal lpfn As Long, _
                             ByVal hmod As Long, _
                             ByVal dwThreadId As Long) As Long

Private Declare Function CallNextHookEx Lib &quot;user32&quot; ( _
                             ByVal hHook As Long, _
                             ByVal nCode As Long, _
                             ByVal wParam As Long, _
                             lParam As Any) As Long

Private Declare Function UnhookWindowsHookEx Lib &quot;user32&quot; ( _
                             ByVal hHook As Long) As Long

Private Declare Function PostMessage Lib &quot;user32.dll&quot; _
                     Alias &quot;PostMessageA&quot; ( _
                             ByVal hwnd As Long, _
                             ByVal wMsg As Long, _
                             ByVal wParam As Long, _
                             ByVal lParam As Long) As Long

Private Declare Function WindowFromPoint Lib &quot;user32&quot; ( _
                             ByVal xPoint As Long, _
                             ByVal yPoint As Long) As Long

Private Declare Function GetCursorPos Lib &quot;user32.dll&quot; ( _
                             ByRef lpPoint As POINTAPI) As Long

Private Const WH_MOUSE_LL As Long = 14
Private Const WM_MOUSEWHEEL As Long = &amp;H20A
Private Const HC_ACTION As Long = 0
Private Const GWL_HINSTANCE As Long = (-6)

Private Const WM_KEYDOWN As Long = &amp;H100
Private Const WM_KEYUP As Long = &amp;H101
Private Const VK_UP As Long = &amp;H26
Private Const VK_DOWN As Long = &amp;H28
Private Const WM_LBUTTONDOWN As Long = &amp;H201

Private mLngMouseHook As Long
Private mListBoxHwnd As Long
Private mbHook As Boolean

Sub HookListBoxScroll()
Dim lngAppInst As Long
Dim hwndUnderCursor As Long
Dim tPT As POINTAPI
        GetCursorPos tPT
        hwndUnderCursor = WindowFromPoint(tPT.x, tPT.y)
        If mListBoxHwnd &lt;&gt; hwndUnderCursor Then
             UnhookListBoxScroll
             mListBoxHwnd = hwndUnderCursor
                lngAppInst = GetWindowLong(mListBoxHwnd, GWL_HINSTANCE)
                PostMessage mListBoxHwnd, WM_LBUTTONDOWN, 0&amp;, 0&amp;
             If Not mbHook Then
                     mLngMouseHook = SetWindowsHookEx( _
                                                     WH_MOUSE_LL, AddressOf MouseProc, lngAppInst, 0)
                     mbHook = mLngMouseHook &lt;&gt; 0
             End If
     End If
End Sub

Sub UnhookListBoxScroll()
     If mbHook Then
             UnhookWindowsHookEx mLngMouseHook
             mLngMouseHook = 0
             mListBoxHwnd = 0
             mbHook = False
     End If
End Sub

Private Function MouseProc( _
             ByVal nCode As Long, ByVal wParam As Long, _
             ByRef lParam As MOUSEHOOKSTRUCT) As Long
        On Error GoTo errH &#39;Resume Next
        If (nCode = HC_ACTION) Then
             If WindowFromPoint(lParam.pt.x, lParam.pt.y) = mListBoxHwnd Then
                     If wParam = WM_MOUSEWHEEL Then
                             MouseProc = True
                             If lParam.hwnd &gt; 0 Then
                                     PostMessage mListBoxHwnd, WM_KEYDOWN, VK_UP, 0
                             Else
                                     PostMessage mListBoxHwnd, WM_KEYDOWN, VK_DOWN, 0
                             End If
                             PostMessage mListBoxHwnd, WM_KEYUP, VK_UP, 0
                             Exit Function
                     End If
             Else
                     UnhookListBoxScroll
             End If
     End If
        MouseProc = CallNextHookEx( _
                             mLngMouseHook, nCode, wParam, ByVal lParam)
     Exit Function
errH:
        UnhookListBoxScroll
End Function
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/2824471935070439593/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2017/03/listbox.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/2824471935070439593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/2824471935070439593'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2017/03/listbox.html' title='ListBoxがマウスのスクロール対応していない？！'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-5688260341520008914</id><published>2017-03-15T16:53:00.000+09:00</published><updated>2017-03-15T16:53:32.903+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="error"/><category scheme="http://www.blogger.com/atom/ns#" term="vba"/><category scheme="http://www.blogger.com/atom/ns#" term="罠"/><title type='text'>VBA DLL を正しく呼び出せません (エラー 49) </title><content type='html'>SubもFunctionもパラメーターの前に&lt;b&gt;ByVa&lt;/b&gt;lか&lt;b&gt;ByRef&lt;/b&gt;かをきちんと書こう！</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/5688260341520008914/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2017/03/vba-dll-49.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/5688260341520008914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/5688260341520008914'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2017/03/vba-dll-49.html' title='VBA DLL を正しく呼び出せません (エラー 49) '/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5317320757157807872.post-7584905859795094237</id><published>2017-02-15T17:52:00.000+09:00</published><updated>2017-02-15T17:52:11.633+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="array"/><category scheme="http://www.blogger.com/atom/ns#" term="vba"/><title type='text'>VBA Arrayの論理計算、交集、並集（AND　OR）（Intersection And Union）（Logical disjunction Logical conjunction）</title><content type='html'>&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;
Option Explicit
Sub testUnionAndIntersection()

&#39;Intersection And Union
&#39;Also called
&#39;Logical disjunction Logical conjunction
&#39;AND OR

Dim a As New Scripting.Dictionary
Dim b As New Scripting.Dictionary
Dim keysA As Variant
Dim keysB As Variant
Dim keysC As Variant
Dim keysD As Variant

a.Add &quot;A&quot;, &quot;&quot;
a.Add &quot;B&quot;, &quot;&quot;
a.Add &quot;C&quot;, &quot;&quot;

b.Add &quot;A&quot;, &quot;&quot;
b.Add &quot;C&quot;, &quot;&quot;
b.Add &quot;X&quot;, &quot;&quot;

keysA = a.Keys
keysB = b.Keys

keysC = getIntersectionSet(keysA, keysB)
Debug.Print Join(keysC, &quot;,&quot;)
&#39;A,C

keysD = getUnionSet(keysA, keysB)
Debug.Print Join(keysD, &quot;,&quot;)
&#39;A,B,C,X

Call DeleteElementAt(1, keysB)
Debug.Print Join(keysB, &quot;,&quot;)
&#39;A,X

End Sub
Function getIntersectionSet(arr1 As Variant, arr2 As Variant) As Variant
Dim vntTmp As Variant
Dim vntRst As Variant

If Not (IsArray(arr1) And IsArray(arr2)) Then
    Exit Function
End If

For Each vntTmp In arr1
    If IsInArray(CStr(vntTmp), arr2) Then
        push vntTmp, vntRst
    End If
Next

getIntersectionSet = vntRst

End Function
Function getUnionSet(arr1 As Variant, arr2 As Variant) As Variant
Dim vntTmp As Variant
Dim vntRst As Variant

If Not (IsArray(arr1) And IsArray(arr2)) Then
    Exit Function
End If

vntRst = arr1

For Each vntTmp In arr2
    If Not IsInArray(CStr(vntTmp), vntRst) Then
        push vntTmp, vntRst
    End If
Next

getUnionSet = vntRst

End Function
Function IsInArray(stringToBeFound As String, arr As Variant) As Boolean
  IsInArray = (UBound(Filter(arr, stringToBeFound)) &gt; -1)
End Function
Public Sub DeleteElementAt(ByVal index As Integer, ByRef prLst As Variant)
       Dim i As Integer
        For i = index + 1 To UBound(prLst)
            prLst(i - 1) = prLst(i)
        Next
        ReDim Preserve prLst(UBound(prLst) - 1)
End Sub

Public Function push(ByVal val As Variant, ByRef arr As Variant, Optional ByVal unique As Boolean = False) As Integer
Dim lngX As Long
    If unique Then
        If Not IsEmpty(arr) Then
            If IsArray(arr) Then
                For lngX = LBound(arr) To UBound(arr)
                    If arr(lngX) = val Then
                        push = UBound(arr)
                        Exit Function
                    End If
                Next
            End If
        End If
    End If
    If IsArray(arr) Then
        On Error GoTo initArray
        ReDim Preserve arr(UBound(arr) + 1)
    Else
initArray:
        ReDim arr(0)
    End If
    If VarType(val) = 9 Then &#39;9 is object
        Set arr(UBound(arr)) = val
    Else
        arr(UBound(arr)) = val
    End If
    push = UBound(arr)
End Function


&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://kagen88.blogspot.com/feeds/7584905859795094237/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://kagen88.blogspot.com/2017/02/vba-arrayandorintersection-and.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/7584905859795094237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5317320757157807872/posts/default/7584905859795094237'/><link rel='alternate' type='text/html' href='http://kagen88.blogspot.com/2017/02/vba-arrayandorintersection-and.html' title='VBA Arrayの論理計算、交集、並集（AND　OR）（Intersection And Union）（Logical disjunction Logical conjunction）'/><author><name>kg88</name><uri>http://www.blogger.com/profile/03439244484411161988</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>