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: 157
Default Border problem with one row but no snag in many rows

Hi,

I have text from B3 to O3.

I recorded a macro to apply "All borders" in this range which I have pasted
below.

If I use the same macro for applying the same border style to some other one
row range like b4 to O4 then macro fails at each of the 3 lines following
"With Selection.Borders(xlInsideHorizontal)"

If I use the same macro for applying the all border to more than one row
range then the macro doesnt fail.

Why?. Surprising thing is the macro itself was recorded based on one row
selection then why is it that it fails inspite of having the same starting
conditions for the macro

Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With


Regards,
Hari
India


 
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
Problem with printing a border in Excel 2007 dlf Excel Discussion (Misc queries) 3 September 12th 09 09:14 PM
Border Problem Gizmo Excel Discussion (Misc queries) 2 May 10th 08 03:53 PM
Cell border problem Brian Excel Discussion (Misc queries) 2 July 31st 07 07:44 PM
bottom double border shorcut key problem Ray Excel Discussion (Misc queries) 1 February 4th 06 05:40 PM
Default Border Color Problem Bobbie Excel Discussion (Misc queries) 1 May 25th 05 06:33 AM


All times are GMT +1. The time now is 11:13 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"