Thread: Tick box
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Jock Jock is offline
external usenet poster
 
Posts: 440
Default Tick box

Hi,
What I was referring to in 'Q1' was that I would have liked cells A to Z
highlighted in a specific row when a cell in M is double clicked. What
happens is that the count of 26 cells starts from the column stated in the
code (M) and ends at AL. I got around this by using B rather than M, so that
B to Z are highlited.
In Q2, there were no border changes done by me to the standard 'new
worksheet' default ones. There is quite a lot of code for different things
within this workbook though, so perhaps they are interfering with your code
slightly: I have tested your codes in a blank workbook and they work fine.

Thanks for your help on this. The yellow highlighted stand out better than
the red bordered ones, I think. Brill

Where's 'ie' by the way (in your email addy)

Many thanks
Jock


" wrote:

Hi
For the thicker border
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
Dim myRow As Range
If Not Intersect(Target, ActiveSheet.Columns("B")) 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.Weight = xlThick
.Borders(xlInsideVertical).Color = RGB(255, 255, 255)

End If
End With
End If
'Cancel = True
End Sub

Q1: I dont' know what you mean by "I have worked around the issue by
using column 'B'." What issue?

Q2 "I have noticed that, after turning the code on and off, certain
cell borders
are missing (columns B & E). Why would this happen?"
Did your data originally have borders round it? My macro will
certainly interfere with that. I couldn't provide a fix without
knowing what the borders are like. Also, if you do have borders
already, putting in a new one is probably not the best thing to do. It
would be better to highlight your data on double click like this

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 .Interior.ColorIndex = 6 Then
.Interior.ColorIndex = xlNone
Else
.Interior.ColorIndex = 6
End If
End With
End If
'Cancel = True
End Sub

regards
Paul

On May 11, 4:21 pm, Jock wrote:
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?
--