2019 excel vba for mac (note 2) - homepage.ntu.edu.tw
TRANSCRIPT
![Page 1: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/1.jpg)
2019 Excel VBA For Mac (Note 2)
![Page 2: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/2.jpg)
叫出 Developer
![Page 3: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/3.jpg)
![Page 4: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/4.jpg)
![Page 5: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/5.jpg)
結果畫面
![Page 6: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/6.jpg)
錄製巨集
![Page 7: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/7.jpg)
![Page 8: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/8.jpg)
輸入需要「重複做」的工作
![Page 9: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/9.jpg)
停止錄製
![Page 10: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/10.jpg)
開啟巨集(左邊為錄製)
![Page 11: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/11.jpg)
選擇要跑的巨集
![Page 12: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/12.jpg)
自動跑出來!
=SUM(C1:C3)
![Page 13: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/13.jpg)
錄製、使用巨集影片示意
![Page 14: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/14.jpg)
編輯巨集 VBA 語法
![Page 15: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/15.jpg)
![Page 16: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/16.jpg)
跳出 VB Editor 視窗
![Page 17: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/17.jpg)
逐步檢視巨集 VBA 語法
![Page 18: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/18.jpg)
![Page 19: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/19.jpg)
跳出視窗(有反黃為目前步驟)
![Page 20: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/20.jpg)
點選「逐行檢視」等就會繼續往下跑
![Page 21: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/21.jpg)
在 Mac 中存帶有巨集的檔案
![Page 22: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/22.jpg)
選擇 .xlsm 結尾的檔案類型
![Page 23: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/23.jpg)
下次開啟檔案時就會詢問要不要啟用巨集
![Page 24: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/24.jpg)
打開 Visual Basic Editor
![Page 25: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/25.jpg)
Visual Basic Editor 視窗畫面
![Page 26: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/26.jpg)
功能區
跑程式使用
寫程式使用
![Page 27: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/27.jpg)
逐行、段落檢視程式碼
![Page 28: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/28.jpg)
逐行、段落檢視的快捷鍵
![Page 29: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/29.jpg)
新增監看視窗
![Page 30: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/30.jpg)
或選取想監看的值按右鍵
![Page 31: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/31.jpg)
設定監看視窗
![Page 32: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/32.jpg)
監看視窗 開始跑程式後會出現數值
![Page 33: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/33.jpg)
叫出規劃求解 Solver 按鈕
![Page 34: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/34.jpg)
![Page 35: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/35.jpg)
在資料分析 tab 中會出現規劃求解
![Page 36: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/36.jpg)
有哪個作業需要用到規劃求解的話(上課會講解)
![Page 37: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/37.jpg)
將過程以巨集錄製
![Page 38: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/38.jpg)
再複製到按鈕的 VBA 程式碼中
![Page 39: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/39.jpg)
跑程式之前要在 VB Editor 中打開 Solver
![Page 40: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/40.jpg)
打勾、OK 就完成了
![Page 41: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/41.jpg)
使用英文版-老師的 VBA 註解變亂碼基本上不影響程式
![Page 42: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/42.jpg)
如果 Mac 可能跑不動這個 VBA read only 還是可以看到程式碼
![Page 43: 2019 Excel VBA For Mac (Note 2) - homepage.ntu.edu.tw](https://reader030.vdocuments.us/reader030/viewer/2022012712/61ab92d75c6ffb247b4ec949/html5/thumbnails/43.jpg)
VBA button 按不下去將程式碼複製並新增㇐個 button
原本的按鈕
新增的按鈕