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: 129
Default Why doesn't this create a boxed range?

Adapted from the recorder. What must be changed to create a border box
around boxrng?

Thanks.

Sub t()
Dim startcell As Range, endcell As Range, boxrng As Range
Dim b As Workbook
Dim s As Worksheet
Set b = ActiveWorkbook
Set s = b.Sheets("Sheet1")


Set startcell = s.Cells(2, 2)
Set endcell = s.Cells(5, 5)
Set boxrng = Range(startcell, endcell)
boxrng.Borders(xlDiagonalDown).LineStyle = xlNone
boxrng.Borders(xlDiagonalUp).LineStyle = xlNone
boxrng.Borders(xlEdgeLeft).LineStyle = xlContinous
boxrng.Borders(xlEdgeTop).LineStyle = xlContinuous
boxrng.Borders(xlEdgeBottom).LineStyle = xlContinous
boxrng.Borders(xlEdgeRight).LineStyle = xlContinuous
boxrng.Borders(xlInsideVertical).LineStyle = xlNone
boxrng.Borders(xlInsideHorizontal).LineStyle = xlNone
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
How do I create a Range Name? Curious New Users to Excel 7 December 14th 07 09:13 PM
Create Named Range in VBA michael.a7[_5_] Excel Programming 2 June 9th 06 12:00 AM
How do I create this range? monica Excel Programming 5 May 8th 06 03:43 PM
Create/copy combo boxes in one range if condition is met in a different range LB[_4_] Excel Programming 4 September 30th 05 12:21 AM
how do i create range names ? april Excel Worksheet Functions 1 September 5th 05 04:33 AM


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