- 帖子
- 92
- 主題
- 18
- 精華
- 0
- 積分
- 195
- 點名
- 0
- 作業系統
- xp
- 軟體版本
- 2003
- 閱讀權限
- 20
- 性別
- 女
- 來自
- 台北
- 註冊時間
- 2010-8-15
- 最後登錄
- 2011-8-11
|
有關OptionButton迴圈問題
以下是我工作表(1)的程式碼,請問OptionButton & i_Click可以寫成迴圈嗎?
還是說每新增一筆選項按鈕的資料,就得新增一次程序?
(如果有1000筆資料,就要Sub 1000次?)
Private Sub OptionButton1_Click()
If OptionButton1 = True Then Cells(1, 2).value = Cells(4, 2)
End Sub
Private Sub OptionButton2_Click()
If OptionButton2 = True Then Cells(1, 2).value = Cells(5, 2)
End Sub
Private Sub OptionButton3_Click()
If OptionButton3 = True Then Cells(1, 2).value = Cells(6, 2)
End Sub
Private Sub OptionButton4_Click()
If OptionButton4 = True Then Cells(1, 2).value = Cells(7, 2)
End Sub
Private Sub OptionButton5_Click()
If OptionButton5 = True Then Cells(1, 2).value = Cells(8, 2)
End Sub
 |
|