2014-06-13 88 views
2

我想在excel文檔打開時默認選擇一個首選的非activex單選按鈕。Excel VBA選項按鈕選擇作爲默認開始

什麼,我試圖做的事:

Private Sub Workbook_Open() 

ActiveSheet.Shapes("Option Button 1").Value = True 

End Sub 

但我收到此錯誤信息:

運行時錯誤 '438':

對象不支持此屬性的方法

回答

2

試試這個:

ActiveSheet.Shapes("Option Button 1").ControlFormat.Value = xlOn 
+1

從這裏:http://stackoverflow.com/questions/6932084/how-to-access-checkbox-from-vba-in-excel-2007 – PerpetualStudent

+0

完美的作品!謝謝 :) – Divin3