Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Excel Constant for Border All Around Cell

Hi.

I'm creating headings dynamically in Excel and am placing a border around
each cell as it's created.
I'd like to be able to border a cell with just 1 Excel constant instead of
having to use 4 - one for each side. Since adding borders, the program has
slowed down considerably. Is there a more efficient way than the one I'm
using now?

'*** Put a border around the heading just added
wshFIC.Cells(iHeadingLine, lLastColumn).Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
End With

'*** Change the font for just this cell
With Selection.Font
.Name = "Arial Narrow"
.Bold = True
.Size = 9
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Interior.ColorIndex = 37
End With

TIA.
Rita

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Excel Constant for Border All Around Cell

Nope there is not one constant for all four sides. The constants are

xlDiagonalDown, xlDiagonalUp, xlEdgeBottom, xlEdgeLeft, xlEdgeRight,
xlEdgeTop, xlInsideHorizontal, or xlInsideVertical

HTH

"RitaG" wrote:

Hi.

I'm creating headings dynamically in Excel and am placing a border around
each cell as it's created.
I'd like to be able to border a cell with just 1 Excel constant instead of
having to use 4 - one for each side. Since adding borders, the program has
slowed down considerably. Is there a more efficient way than the one I'm
using now?

'*** Put a border around the heading just added
wshFIC.Cells(iHeadingLine, lLastColumn).Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
End With

'*** Change the font for just this cell
With Selection.Font
.Name = "Arial Narrow"
.Bold = True
.Size = 9
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Interior.ColorIndex = 37
End With

TIA.
Rita

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Excel Constant for Border All Around Cell

Pity. Thanks for your response.

"Jim Thomlinson" wrote:

Nope there is not one constant for all four sides. The constants are

xlDiagonalDown, xlDiagonalUp, xlEdgeBottom, xlEdgeLeft, xlEdgeRight,
xlEdgeTop, xlInsideHorizontal, or xlInsideVertical

HTH

"RitaG" wrote:

Hi.

I'm creating headings dynamically in Excel and am placing a border around
each cell as it's created.
I'd like to be able to border a cell with just 1 Excel constant instead of
having to use 4 - one for each side. Since adding borders, the program has
slowed down considerably. Is there a more efficient way than the one I'm
using now?

'*** Put a border around the heading just added
wshFIC.Cells(iHeadingLine, lLastColumn).Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
End With

'*** Change the font for just this cell
With Selection.Font
.Name = "Arial Narrow"
.Bold = True
.Size = 9
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Interior.ColorIndex = 37
End With

TIA.
Rita

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 186
Default Excel Constant for Border All Around Cell

Rita, this line will fix you right up :)

Selection.BorderAround xlContinuous, xlThin

-Jack



"RitaG" wrote:

Hi.

I'm creating headings dynamically in Excel and am placing a border around
each cell as it's created.
I'd like to be able to border a cell with just 1 Excel constant instead of
having to use 4 - one for each side. Since adding borders, the program has
slowed down considerably. Is there a more efficient way than the one I'm
using now?

'*** Put a border around the heading just added
wshFIC.Cells(iHeadingLine, lLastColumn).Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
End With

'*** Change the font for just this cell
With Selection.Font
.Name = "Arial Narrow"
.Bold = True
.Size = 9
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Interior.ColorIndex = 37
End With

TIA.
Rita

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Excel Constant for Border All Around Cell

And I've been doing it the hard way... :)

"Jack" wrote:

Rita, this line will fix you right up :)

Selection.BorderAround xlContinuous, xlThin

-Jack



"RitaG" wrote:

Hi.

I'm creating headings dynamically in Excel and am placing a border around
each cell as it's created.
I'd like to be able to border a cell with just 1 Excel constant instead of
having to use 4 - one for each side. Since adding borders, the program has
slowed down considerably. Is there a more efficient way than the one I'm
using now?

'*** Put a border around the heading just added
wshFIC.Cells(iHeadingLine, lLastColumn).Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
End With

'*** Change the font for just this cell
With Selection.Font
.Name = "Arial Narrow"
.Bold = True
.Size = 9
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Interior.ColorIndex = 37
End With

TIA.
Rita



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Excel Constant for Border All Around Cell

Fabulous! So much better - thanks.

"Jack" wrote:

Rita, this line will fix you right up :)

Selection.BorderAround xlContinuous, xlThin

-Jack



"RitaG" wrote:

Hi.

I'm creating headings dynamically in Excel and am placing a border around
each cell as it's created.
I'd like to be able to border a cell with just 1 Excel constant instead of
having to use 4 - one for each side. Since adding borders, the program has
slowed down considerably. Is there a more efficient way than the one I'm
using now?

'*** Put a border around the heading just added
wshFIC.Cells(iHeadingLine, lLastColumn).Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
End With

'*** Change the font for just this cell
With Selection.Font
.Name = "Arial Narrow"
.Bold = True
.Size = 9
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Interior.ColorIndex = 37
End With

TIA.
Rita

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
border on last cell of page effects border on beginning cell of ne GaryE Excel Discussion (Misc queries) 0 March 23rd 09 05:47 AM
excel uses what technique to keep a cell reference constant when ajbanana Excel Discussion (Misc queries) 2 January 31st 07 07:31 AM
cell border colors in Excel Rob Excel Discussion (Misc queries) 9 April 25th 06 01:44 AM
cell border in excel MickeyJim Excel Discussion (Misc queries) 2 January 7th 06 12:54 PM
Changing the border of one cell s/n change the border of adjacent gjanssenmn Excel Discussion (Misc queries) 2 October 5th 05 08:35 PM


All times are GMT +1. The time now is 01:10 AM.

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"