| すぐマク YNxv983625 | Home | Search | Contents | Gallery | Introduction | Service | Support | What's New! |
| セルの値から年を和暦で取得するには? |
|
|
|||||
|
どなたか教えて下さい。 Year(日付)とすると、西暦の値が返ってきますよね? 例えば(日付)が「平成15年4月1日」だとすると、値は「2003」が返ってくると思います。 でわなくて、「平成15年」の「15」の値がほしいのですが、サクッとできる方法はないでしょうか? |
|
|||
書式設定で日付関数の "e" は平成15年の15です。
Range("a2").Select
Selection.NumberFormatLocal = "e"
d = Range("a2").Text
value ではなく Text を使えばOK
|
|
|||||
| すごいサクッとできました |
| http://www.geocities.jp/happy_ngi/ | Home | Contents | Gallery | Introduction | Service | Support | What's New! |