Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating right and bottom borders code not working

Status
Not open for further replies.

gdev

Technical User
Mar 12, 2001
38
0
0
Why isn't this code working?
I want bottom and right borders from a7:l7 to the last
row.

Dim rng As Range

Set rng = Range(Cells(Rows.Count, "A").End(xlUp), Range("L7"))


With rng
.Borders.LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlContinuous
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeRight).LineStyle = xlContinuous
End With

Please assist.
Thanks
 




Hi,
Code:
    Dim rng As Range
'I want bottom and right borders from a7:l7 to the last row.
    Set rng = Range("a7:l7")
    Set rng = Range(rng, rng.End(xlDown))

Skip,
[sub]
[glasses] When a wee mystic is on the loose..
It's a Small Medium at Large! [tongue][/sub]
 
Thank you. However, the bottom border is working but not the right border.

Any suggestions?
 




Works for me, like this...
[tt]
_____________________|
_____________________|
_____________________|
_____________________|
_____________________|

[/tt]


Skip,
[sub]
[glasses] When a wee mystic is on the loose..
It's a Small Medium at Large! [tongue][/sub]
 
Do you get a right border for each column?



_____|________|________|
_____|________|________|
 



No. You don't have an xlInsideVertical.

Skip,
[sub]
[glasses] When a wee mystic is on the loose..
It's a Small Medium at Large! [tongue][/sub]
 
That's it!
Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top