2011年1月1日土曜日

perlでEXCELの仕事を効率化

 ワタシとperlとの出会いは、仕事場でperlで実用的なツールで効率アップしていた凄い人がいたから。

 その後、といっても、2002、3年ごろに日経でのスクリプト特集記事(なぜか、カワセミなど野鳥が散りばめられた、楽しい感じの)がその夏の愛読記事となり、何回読んだことが。Run Run Linux以来、ハマりました。

perlでEXCELのいろいろ記事
まず、CodeZine
http://codezine.jp/article/detail/904
日経 ITpro
http://itpro.nikkeibp.co.jp/article/COLUMN/20080528/304529/





2010年12月5日日曜日

EXCEL VBAで出力したメッセージをコピペする方法 vba copy-paste-able msgbox

 EXCEL VBAでMsgboxを使用してメッセージを出力した場合、そのメッセージをコピペして貼り付けることはできない。
そこで、発想の転換だ。
 Msgboxではなく、inputboxのDefaultでメッセージを出してしまえばよい。データの入力域にデフォルト値として、自分がコピペしたい文字列を出力しておけばよいのである。目から鱗のVBAテクニックといえるのではないだろうか?
 具体的には、Msgbox mojiretsuを出力していたのをInputbox (prompt:="コピペできるよ”,default:=mojiretsu)とすればよい。
  • Inputしないのに、Inputboxを使うのがミソだ。
InputBox Prompt = "どうぞ、コピペされたし(please copy and paste)",Default:=strings
なお、inputboxで出したメッセージをコピーした後、そのメッセージのウィンドウを閉じないと、ペーストの操作ができないので、注意してください。


When using Msgbox to output a message in EXCEL VBA, you can't copy and paste the message. So you need smoke and mirrors. Use Inputbox with a default message that you want to output.
  • Inputbox ( prompt =" copy and paste this message", default:=the-message-you wan-to output
Using Inputdata is the point, despite of no-need for input, Paradox!

To paste it after copying the message output by Inputbox, you need close the message window.
ヤモリ


この技を使うと、こんなこともできる。

This VBA tips also enables to spread your wings like this:

EXCEL 仕事でつかえる小技 VBAで複数セル(文字列)の連結 EXCEL Tips at work-- VBA concatenating two cells

EXCELのVBAでIEブラウザを自動で立上げ、目的のWebページでジャンプ、ログインページでは、ユーザIDとパスワードを投入し、セキュリティをパスし、いろんなボタン、ラジオボタンも押し、Webページを自在に遷移し、そして、目的のデータを根こそぎ取ってくるワザを紹介。仕事で覚えたEXEL小技をまとめたページを作ったので、見てね。


2009年9月5日土曜日

MS VC++ 2008 afxres.hがないことによる、エラーは、MS SDKにあるものをincludeファイルのディレクトリに指定してやればよい。
http://d.hatena.ne.jp/zuzu_sion/20081125/1227680361

2009年3月7日土曜日

excelで前月の最終月曜日を計算する EXCEL fuction calendar and when is the last Monday of every month

EXCELのお勉強を兼ねて、いきなりですが、仕事で使える、EXCELの関数の小技をひとつ。Here's EXCEL function's Tips - when is the last Monday of every month ?

A1=2009(年) A2=3(月)と仮定する。
=DATE(A1,A2,0)-WEEKDAY(DATE(A1,A2,0),3)
で、2月の最終月曜日が求まる。

When the vallue of A1 cell(Year) is "2009" and the value of A2(Month) is "03"
"DATE(A1,A2,0)-WEEKDAY(DATE(A1,A2,0),3)" shows the last Monday of February.

WEEKDAY関数の第2引数に3を指定すると、月曜日からの経過日数がわかる。
その分だけ引けば、月曜日がわかる。

If you specify the second parameter of WEEKDAY "3", you can get how many days from Monday.

さて、この技を何に使うかというと、
この関数をキーにして、日を+1して、7個のセルを作れば、1週間ができる。
さらに、4、5列並べれば、1ケ月のカレンダーになる。

This tips enable for you to make Monthly calendar or simple schedule book.
By making this cell a starting point, Add day +1 till +7 ( Monday to Sunday )
And you can get a week, Add more 4 , 5 times., you'll get a month's calendar, Right?

イメージは、こんな感じ。
[A1]=YEAR
[A2]=MONTH

For example,
[A11]=DATE(A1,A2,0)-WEEKDAY(DATE(A1,A2,0),3)   =A11+1  =A11+2 ・・・=A11+7
{A14]=A11+14 =A14+1 ・・・A14+7

つまり、上記の関数があれば、EXCELで1シートで1ケ月の1週間が月曜日で
始まるの自作カレンダーを作れるンですよ。

By using above the function's tips, you'll get your own calendar which every week starts from Monday with one sheet of EXCEL.

さらに、
In addition,


これで、会社で使う予定表の一丁あがり。
You'll get your own schedule book by EXCEL.