#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default Tick box

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Tick box

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default Tick box

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Tick box

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default Tick box

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default Tick box

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tick box how do i? plz Nevyn Excel Discussion (Misc queries) 1 December 9th 09 11:02 PM
tick box rexmann Excel Discussion (Misc queries) 0 April 14th 08 10:21 AM
tick box, how to set up Tiddler Excel Discussion (Misc queries) 9 December 15th 05 06:08 AM
tick Lyn Excel Discussion (Misc queries) 1 August 15th 05 01:19 AM
tick box Chink! Excel Discussion (Misc queries) 3 April 16th 05 04:32 PM


All times are GMT +1. The time now is 01:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"