Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Borders question, please

If I run the following code (which colours unlocked cells) and
many contiguous cells become coloured, then it becomes a little
difficult to orientate within the sheet:

For Each c In .UsedRange.Columns("A:G")
For Each cell In c.Cells
With cell
If Not cell.Locked = True Then
'User is permitted to edit this cell, so color it:
With cell
.Interior.ColorIndex = 34
End With
End If
End With
Next cell
Next c

What are the correct statements please, that will format just the
top and bottom borders of each coloured cell to the default
(feint) Xl style?

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.692 / Virus Database: 453 - Release Date: 28/05/2004


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Borders question, please

Stuart

you could try a variation on this sample:

With Range("E8:I16")
With .Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
End With

Regards

Trevor


"Stuart" wrote in message
...
If I run the following code (which colours unlocked cells) and
many contiguous cells become coloured, then it becomes a little
difficult to orientate within the sheet:

For Each c In .UsedRange.Columns("A:G")
For Each cell In c.Cells
With cell
If Not cell.Locked = True Then
'User is permitted to edit this cell, so color it:
With cell
.Interior.ColorIndex = 34
End With
End If
End With
Next cell
Next c

What are the correct statements please, that will format just the
top and bottom borders of each coloured cell to the default
(feint) Xl style?

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.692 / Virus Database: 453 - Release Date: 28/05/2004




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Borders question, please

Many thanks.

Regards.

"Trevor Shuttleworth" wrote in message
...
Stuart

you could try a variation on this sample:

With Range("E8:I16")
With .Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
End With

Regards

Trevor


"Stuart" wrote in message
...
If I run the following code (which colours unlocked cells) and
many contiguous cells become coloured, then it becomes a little
difficult to orientate within the sheet:

For Each c In .UsedRange.Columns("A:G")
For Each cell In c.Cells
With cell
If Not cell.Locked = True Then
'User is permitted to edit this cell, so color it:
With cell
.Interior.ColorIndex = 34
End With
End If
End With
Next cell
Next c

What are the correct statements please, that will format just the
top and bottom borders of each coloured cell to the default
(feint) Xl style?

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.692 / Virus Database: 453 - Release Date: 28/05/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.692 / Virus Database: 453 - Release Date: 28/05/2004


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
Micro to do borders question. Damian Excel Discussion (Misc queries) 3 August 31st 09 05:32 PM
Question about borders Paul Allor Excel Discussion (Misc queries) 3 September 14th 07 03:16 PM
Question about Cell Borders Kevin New Users to Excel 2 April 13th 05 01:36 AM
Borders linda Excel Discussion (Misc queries) 2 January 28th 05 01:05 PM
A Borders question Stuart[_5_] Excel Programming 4 October 6th 03 11:13 PM


All times are GMT +1. The time now is 04:28 PM.

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

About Us

"It's about Microsoft Excel"