エクセルのワークシートをテキスト化して簡単に通信  

 

抄録(abstract)
エクセルのワークシートをテキスト化して通信する。
Converting Excel worksheets into text and communicating


エクセルのシートをテキスト化すると聞くとマクロとかVBAの勉強をする必要があると勘違いするかもしれない。しかし、そのような面倒な勉強をすることなく誰でも私でもできる方法がある。少し複雑な計算をしているようなワークシートでもコンパクトなワークシートであれば容易にテキスト化して、それを相手に送り、受信者は容易にエクセルシートを再現できる。この方法のメリットはメールにワークシートを添付する必要がないことである。
 セキュリティ対策の厳格化で組織によっては添付メールをブロックするかもしれない。個人でも添付ファイルを警戒する人は少なくないだろう。特に無名のサイトでエクセルのワークシートが開示されていても開かないかもしれない。
 しかし、テキストファイルであれば何かマクロや隠しファイルを埋めこんだりする可能性は非常に低いだろう。

手順は簡単である。

1.基本的には元のワークシートはセル番地A1を原点として作成する。

2.出来上がったワークシートを数式表示にする。
メニューの「数式」から「数式の表示」をクリックする。
「数式の表示」はワークシート分析という文字の上の方にアイコンで逆三角形Nablaとfxを合わせた絵のアイコンで表示されているかもしれない。

3.この数式表示されたワークシートを全部選択し(空白部分も含めて)コピーしてメモ帳に貼りつける。
ここで内部的には「タブ区切りテキスト」 として処理される。

このメモ帳を適当な名前を付けてテキストファイルとして保存しメールに添付したり自分のホームページにアップして利用することができる。
 もちろん、直接にメール本文に貼りつけることもできる。

4.受信者ないしは利用者はテキストファイルの全部をコピーして、自分で新しく開いたエクセルのワークシートのセル番地A1に貼りつける。最近のエクセルはタブをセル区切りとして認識してワークシートを復元する。

5.受信者側で送信者のエクセルのワークシートが再現される。

この方法はエクセル2016のバージョンからできるようである。それより前のバージョンだとセルA1の内容の分割作業が必要がもしれない。

 以上の様な利用法はエクセルのワークシートをプログラムのソースコードのようなイメージで取り扱えるので大変に便利だと思う。

幾つかの実例を示すと

エクセルでカルマンフィルタ  (Kalman filtering and smoothing with Excel and R) 

 

 

エクセルで簡単な行列演算(3資産ポートフォリオ分析のために)portfolio analysis using Excel matrix functions

 

summary
Converting Excel worksheets into text and communicating
The steps are as follows:
  1. Basically, create the original worksheet with cell address A1 as the origin.  
 2. Display the formulas for the completed worksheet. Click "Show Formulas" from the "Formulas" menu. "Show Formulas" may be displayed as an icon depicting an inverted triangle (Nabla) and an FX symbol above the words "Worksheet Analysis."  
 3. Select the entire worksheet with formulas displayed (including blank areas), copy it, and paste it into Notepad. This will internally process it as "tab-delimited text."   This Notepad file can be saved with an appropriate name as a text file and attached to an email or uploaded to your own website.   Of course, you can also paste it directly into the body of an email.  
 4. The recipient or user copies the entire text file and pastes it into cell address A1 of a newly opened Excel worksheet. Recent versions of Excel recognize tabs as cell separators and restore the worksheet.  
 5. The sender's Excel worksheet will be reproduced on the recipient's side.

This method seems to be available from Excel 2016 onwards. With earlier versions, it may be necessary to split the contents of cell A1. I think this type of usage is very convenient, as it allows you to treat an Excel worksheet like program source code.






 

 

 

 

 

 

金融工学を初等数学で 目次