L
L Mehl
Hello --
Some columns in a data table are:
- ItemType
- ItemName
- SelectThisRecordYN
The user wants to do the following:
- select the ItemType from a listbox (this is working),
- filter the data table on that ItemType, and
- change Yes/No values in the SelectThisRecordYN column for one or more
records.
The Yes/No values are indicated by a checkmark and a blank, respectively.
In the un-AutoFiltered table, the code at the bottom of this message (from
an earlier posting in this group) translates a double-click on the cell into
a checkmark/tickmark, and a second double-click to a blank (erases the
mark). The column is formatted with the Marlett font; in this font, an "a"
displays as a checkmark; "nothing" displays as a blank.
When I AutoFilter the table on the ItemType column, this double-clicking
code does not work.
Does anyone know what I am doing wrong?
Thanks for any help.
Larry Mehl
-----------------------
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As
Excel.Range, Cancel As Boolean)
' "toggle" the value of a cell in the named range "sendFlags"
' between True and False when the cell is double clicked
' (values switch between a checkmark and blank)
'format the column as
' bold
' font = Marlett; "a" --> a checkmark
' alignment - vertical - center
If Not Intersect(Target, Me.Range("sendFlags")) Is Nothing Then
Cancel = True
If Target.Value = "a" Then
Me.Range(Target.Address).Value = ""
Else
Me.Range(Target.Address).Value = "a"
End If
End If
End Sub
Some columns in a data table are:
- ItemType
- ItemName
- SelectThisRecordYN
The user wants to do the following:
- select the ItemType from a listbox (this is working),
- filter the data table on that ItemType, and
- change Yes/No values in the SelectThisRecordYN column for one or more
records.
The Yes/No values are indicated by a checkmark and a blank, respectively.
In the un-AutoFiltered table, the code at the bottom of this message (from
an earlier posting in this group) translates a double-click on the cell into
a checkmark/tickmark, and a second double-click to a blank (erases the
mark). The column is formatted with the Marlett font; in this font, an "a"
displays as a checkmark; "nothing" displays as a blank.
When I AutoFilter the table on the ItemType column, this double-clicking
code does not work.
Does anyone know what I am doing wrong?
Thanks for any help.
Larry Mehl
-----------------------
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As
Excel.Range, Cancel As Boolean)
' "toggle" the value of a cell in the named range "sendFlags"
' between True and False when the cell is double clicked
' (values switch between a checkmark and blank)
'format the column as
' bold
' font = Marlett; "a" --> a checkmark
' alignment - vertical - center
If Not Intersect(Target, Me.Range("sendFlags")) Is Nothing Then
Cancel = True
If Target.Value = "a" Then
Me.Range(Target.Address).Value = ""
Else
Me.Range(Target.Address).Value = "a"
End If
End If
End Sub