Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can I have a column formatted similar to a tick box which will, when a cell
is 'ticked', turn the cell red or flash red every second or have a flag (like the prioity flag within Outlook) appear in the cell or put a red border around the row (A-Z) in which the 'tic' box cell is in? I actually would prefre the latter of the options if poss. Lots to chew on there! -- tia Jock |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
You should be able to adapt this (for your preferred option). It runs when you double click a cell in the first column (A). Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim myRow As Range If Not Intersect(Target, ActiveSheet.Columns("A")) Is Nothing Then Set myRow = Target.Resize(, 26) With myRow .Borders.Color = RGB(255, 0, 0) .Borders(xlInsideVertical).Color = RGB(255, 255, 255) End With End If 'Cancel = True End Sub Open the VBE and double click the sheet name you want this to work on. Paste in this code. Putting Cancel = True stops people editing the cell after double clicking, which may not be what you want (so I've left it commented out). regrds Paul On May 11, 2:16 pm, Jock wrote: Can I have a column formatted similar to a tick box which will, when a cell is 'ticked', turn the cell red or flash red every second or have a flag (like the prioity flag within Outlook) appear in the cell or put a red border around the row (A-Z) in which the 'tic' box cell is in? I actually would prefre the latter of the options if poss. Lots to chew on there! -- tia Jock |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Paul,
Excellent stuff. However, My column is 'M' and the bordered area is from 'M' to 'AL' rather than 'A' - 'Z'. Can that be adapted? Also, I'd like to be able to double click a second time to "de-border" the cells. I don't know if this is poss, but all help greatly appreciated. Thanks, Jock " wrote: Hi You should be able to adapt this (for your preferred option). It runs when you double click a cell in the first column (A). Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim myRow As Range If Not Intersect(Target, ActiveSheet.Columns("A")) Is Nothing Then Set myRow = Target.Resize(, 26) With myRow .Borders.Color = RGB(255, 0, 0) .Borders(xlInsideVertical).Color = RGB(255, 255, 255) End With End If 'Cancel = True End Sub Open the VBE and double click the sheet name you want this to work on. Paste in this code. Putting Cancel = True stops people editing the cell after double clicking, which may not be what you want (so I've left it commented out). regrds Paul On May 11, 2:16 pm, Jock wrote: Can I have a column formatted similar to a tick box which will, when a cell is 'ticked', turn the cell red or flash red every second or have a flag (like the prioity flag within Outlook) appear in the cell or put a red border around the row (A-Z) in which the 'tic' box cell is in? I actually would prefre the latter of the options if poss. Lots to chew on there! -- tia Jock |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
1. Did you try changing the A to an M??! 2. For the deselect you could try Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim myRow As Range If Not Intersect(Target, ActiveSheet.Columns("M")) Is Nothing Then Set myRow = Target.Resize(, 26) With myRow If .Borders(xlEdgeTop).Color = RGB(255, 0, 0) then .Borders.LineStyle = xlnone Else .Borders.Color = RGB(255, 0, 0) .Borders(xlInsideVertical).Color = RGB(255, 255, 255) End If End With End If 'Cancel = True End Sub regards Paul On May 11, 3:02 pm, Jock wrote: Hi Paul, Excellent stuff. However, My column is 'M' and the bordered area is from 'M' to 'AL' rather than 'A' - 'Z'. Can that be adapted? Also, I'd like to be able to double click a second time to "de-border" the cells. I don't know if this is poss, but all help greatly appreciated. Thanks, Jock |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That turns it on and off ok. Thanks.
I had already changed A to M but, the code works to the right of the cell double clicked. Thanks Jock " wrote: Hi 1. Did you try changing the A to an M??! 2. For the deselect you could try Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim myRow As Range If Not Intersect(Target, ActiveSheet.Columns("M")) Is Nothing Then Set myRow = Target.Resize(, 26) With myRow If .Borders(xlEdgeTop).Color = RGB(255, 0, 0) then .Borders.LineStyle = xlnone Else .Borders.Color = RGB(255, 0, 0) .Borders(xlInsideVertical).Color = RGB(255, 255, 255) End If End With End If 'Cancel = True End Sub regards Paul On May 11, 3:02 pm, Jock wrote: Hi Paul, Excellent stuff. However, My column is 'M' and the bordered area is from 'M' to 'AL' rather than 'A' - 'Z'. Can that be adapted? Also, I'd like to be able to double click a second time to "de-border" the cells. I don't know if this is poss, but all help greatly appreciated. Thanks, Jock |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have worked around th issue by using column 'B'.
I have noticed that, after turning the code on and off, certain cell borders are missing (columns B & E). Why would this happen? Is it possible to use a wider (thicker) red border? -- tia Jock "Jock" wrote: That turns it on and off ok. Thanks. I had already changed A to M but, the code works to the right of the cell double clicked. Thanks Jock " wrote: Hi 1. Did you try changing the A to an M??! 2. For the deselect you could try Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim myRow As Range If Not Intersect(Target, ActiveSheet.Columns("M")) Is Nothing Then Set myRow = Target.Resize(, 26) With myRow If .Borders(xlEdgeTop).Color = RGB(255, 0, 0) then .Borders.LineStyle = xlnone Else .Borders.Color = RGB(255, 0, 0) .Borders(xlInsideVertical).Color = RGB(255, 255, 255) End If End With End If 'Cancel = True End Sub regards Paul On May 11, 3:02 pm, Jock wrote: Hi Paul, Excellent stuff. However, My column is 'M' and the bordered area is from 'M' to 'AL' rather than 'A' - 'Z'. Can that be adapted? Also, I'd like to be able to double click a second time to "de-border" the cells. I don't know if this is poss, but all help greatly appreciated. Thanks, Jock |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Tick box how do i? plz | Excel Discussion (Misc queries) | |||
tick box | Excel Discussion (Misc queries) | |||
tick box, how to set up | Excel Discussion (Misc queries) | |||
tick | Excel Discussion (Misc queries) | |||
tick box | Excel Discussion (Misc queries) |