![](https://livestylewebsitestorage.blob.core.windows.net/livestylewebsitescontainer/2020/05/Office365-topic-blogmain.png)
Web 版 Excel ではデスクトップ版 Excel にあるマクロが使えませんが、その代わりに「Office スクリプト」が用意されていて、簡単に自動化が行えます。定期的に行う業務、定型業務などの自動化に役立ちます。
今回は、Office スクリプトの基本操作を試してみたいと思います。
Office スクリプトを使用するための要件
- Windows、Mac 用、または Web 上の Excel
- OneDrive for Business
- Microsoft 365 Office デスクトップ アプリにアクセスできる Microsoft 365 ライセンス
操作を記録する
①Web 版 Excel で Excel ブックを開きます
②[自動化]タブを開き、[操作を記録]をクリックします
![](https://livestylewebsitestorage.blob.core.windows.net/livestylewebsitescontainer/2023/02/office-scripts-for-excel-on-the-web_1-1024x736.png)
③自動化する操作を Excel 上で行い、操作が完了したら [停止] します
![](https://livestylewebsitestorage.blob.core.windows.net/livestylewebsitescontainer/2023/02/office-scripts-for-excel-on-the-web_2-1024x646.png)
操作を再現する
①Web 版 Excel で 操作前のExcel ブックを開きます
②[自動化]タブを開き、記録したスクリプトを選択し実行します
![](https://livestylewebsitestorage.blob.core.windows.net/livestylewebsitescontainer/2023/02/office-scripts-for-excel-on-the-web_3-1024x419.png)
コード エディタでスクリプトを編集する
①Web 版 Excel で 操作前のExcel ブックを開きます
②[自動化]タブを開き、記録したスクリプトを選択し編集します
コードエディタを使い、誤った操作の修正や処理の追加、Excel のUIからでは直接アクセスできないロジックや機能を追加することもできます
![](https://livestylewebsitestorage.blob.core.windows.net/livestylewebsitescontainer/2023/02/office-scripts-for-excel-on-the-web_4-1024x714.png)