返回列表 上一主題 發帖

[發問] 大量複選表單的程式碼如何簡潔的操作?

本帖最後由 c_c_lai 於 2016-12-23 07:11 編輯

回復 3# starry1314
#2 資料不變,只需再增加一個按鈕就行了:
  1. Private Sub CommandButton3_Click()      '  比對選用資料
  2.     Dim ct As Variant
  3.    
  4.     With MultiPage1.Pages(0)
  5.         For Each ct In .Controls
  6.             If Sheets("選用資料").Columns("B:B").Find(ct.Caption, lookat:=xlWhole) Is Nothing Then
  7.                 ct.Object.Value = False
  8.             Else
  9.                 ct.Object.Value = True
  10.             End If
  11.         Next
  12.     End With
  13. End Sub
複製代碼

TOP

        靜思自在 : 小事不做、大事難成。
返回列表 上一主題