ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Enter a "checkmark" in an AutoFiltered cell (https://www.excelbanter.com/excel-programming/311285-enter-checkmark-autofiltered-cell.html)

L Mehl

Enter a "checkmark" in an AutoFiltered cell
 
Hello --

Some columns in a data table a
- 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



Dave Peterson[_3_]

Enter a "checkmark" in an AutoFiltered cell
 
Your code worked ok for me in a filtered worksheet in xl2002.

Are you sure your range("sendflags") is as large as you want?

L Mehl wrote:

Hello --

Some columns in a data table a
- 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


--

Dave Peterson


L Mehl

Enter a "checkmark" in an AutoFiltered cell
 
Dave --

The range is the correct size.

It works now.

Thanks for listening.

Larry

"Dave Peterson" wrote in message
...
Your code worked ok for me in a filtered worksheet in xl2002.

Are you sure your range("sendflags") is as large as you want?

L Mehl wrote:

Hello --

Some columns in a data table a
- 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


--

Dave Peterson





All times are GMT +1. The time now is 07:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com