[VBA ] 問一個按紐得問題
我寫了一個 利用excel欄位去控制 commandbutton1 是否可作用 (enable)的程式
程式碼如下
Private Sub worksheet_Change(ByVal Target As Range)
If sheet2.Cells(5, 25) = "1" Then
CommandButton1.Enabled = True
Else
CommandButton1.Enabled = flase
End If
End Sub
如果shee2 (5,25)這個欄位等於1得話,那麼 CommandButton1就可以使用
不等於1的話,CommandButton1就會變灰色,無法執行我上一段code
由於我這個1,是用dde傳輸的,所以輸入完之後,還得用手動按兩下(5,25)這一格
CommandButton1才會enable
想請問一下
有沒有哪個程式碼 可以在(5,25)接受到1這個值之後
讓他雙擊兩下 ?
以下是我的程式碼
If sheet2.Cells(5, 25) = "1" THEN
sheet2.Cells(5, 25)_DBCLICK
但是這樣好像無用....
--
-- 痛飲狂歌空度日 拔劍四顧心茫茫 --
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.132.105.48