本帖最后由 regarmy 于 2024-1-14 09:49 编辑
Private Sub Spread_CellClick(sender As Object, e As CellClickEventArgs) Handles Spread.CellClick
Dim CeVal As Boolean
If e.ColumnHeader Then
If e.Column = 2 Then
CeVal = Spread.ActiveSheet.ColumnHeader.Cells(0, 2).Value
Spread.ActiveSheet.ColumnHeader.Cells(0, 2).Value = Not CeVal
For index = 0 To Spread.ActiveSheet.RowCount() - 1
Spread.ActiveSheet.Cells(index, 2).Value = Spread.ActiveSheet.ColumnHeader.Cells(0, 2).Value
Next
End If
End If
End Sub 这样就可以了 |