LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Border formatting row of cells

With the activecell in column C selected, this does a decent job of running from C to column V and formats the cells borders as wanted.

It is a bit slow but is not dealing with massive volumes of cells and its use is not "gotta get as many as possible done as soon as possible" type scenario.

However, I am wondering if there is a way to code this to act on a specified row that does the range all at once. Say an inputbox asking for the row number.

The inputbox I can do myself, the greater hurdles are this:

You will note that the first cell borders are three sided and then the next cell is four sided. So a two cell range in the row will have a left, right, top and bottom as a solid border line and a vertical light dotted line as a divider.

Secondly the row may have some cells that are colorindex various colors. (To tell the user these cells are reserved and not available.)

On the rows with the some colors in them, I need the border formatting code to skip those and continue to column V.

Skipping the colors is my major hurdle. And staying in sequence with the cells that take three borders and the cells that take four borders.

Thanks.
Howard


Option Explicit

Sub ReFormatRow()
'/ From column C to column V

Dim i As Long

For i = 1 To 10

With ActiveCell.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With

With ActiveCell.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With

With ActiveCell.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With

ActiveCell.Offset(, 1).Select

With ActiveCell.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlHairline
End With
With ActiveCell.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With ActiveCell.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With ActiveCell.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With

ActiveCell.Offset(, 1).Select
Next

End Sub
 
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 around range working -Border for cells within range not wor Gwen Excel Programming 3 October 23rd 07 08:45 PM
Apply bottom border only on filled cells, leaves blank cells without border? StargateFan[_3_] Excel Programming 4 April 8th 07 05:39 PM
Lost Border Formatting CW Excel Discussion (Misc queries) 0 July 6th 06 09:17 PM
Conditional Formatting - Frame cells with Outline Border Sam Excel Discussion (Misc queries) 2 June 20th 06 05:38 PM
Insert Rows with Border Formatting ksp Excel Programming 3 May 2nd 06 01:50 AM


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

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"