回覆列表
  • 1 # 使用者7937086446921

    用 下面這段程式碼:

    Sub howmanychk()

    For Each chk In ActiveSheet.CheckBoxes

    If chk.Value = 1 Then j = j + 1

    Next

    MsgBox "共有【" & j & "】個勾選!", vbInformation

    End Sub

    結果是:

    如果只統計D列一年級的勾選,可以用下面的程式碼

    Sub Howmany1()

    For Each chk In ActiveSheet.CheckBoxes

    If chk.Value = 1 And Left(chk.TopLeftCell.Address, 2) = "$D" Then j = j + 1

    Next

    MsgBox "共有【" & j & "】個勾選!", vbInformation

    End Sub

  • 中秋節和大豐收的關聯?
  • 分居多久算離婚?