Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following code fails at the BorderAround line. What am I missing?
With Range(Cells(6, 1), Cells(7, 2)) .BorderAround Weight:=xlMedium .Borders.Item(xlInsideHorizontal).LineStyle = xlContinuous .Borders.Item(xlInsideHorizontal).Weight = xlThin End With I know this is simple, but from what I read it should work. Thanks, John |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi John,
Your code works fine for me. Would fail though if the activesheet is not a worksheet, or if a worksheet chart is selected. Any protection? Regards, Peter T wrote in message oups.com... The following code fails at the BorderAround line. What am I missing? With Range(Cells(6, 1), Cells(7, 2)) .BorderAround Weight:=xlMedium .Borders.Item(xlInsideHorizontal).LineStyle = xlContinuous .Borders.Item(xlInsideHorizontal).Weight = xlThin End With I know this is simple, but from what I read it should work. Thanks, John |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The sheet on which I want this to happen is active and not protected.
I get a "BorderAround method of Range class failed" error. I can use 4 lines to set the border on the edges, but I want to understand this. I'm running xl2003 in XP, if that matters. Thanks, John |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Got it! It was being protected by errant code. Thanks.
John |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Afraid I'm out of ideas, as I said it worked for me.
If you try something else before BorderAround does it work With Range(Cells(6, 1), Cells(7, 2)) .Interior.ColorIndex = 6 .BorderAround Weight:=xlMedium Regards, Peter T wrote in message oups.com... The sheet on which I want this to happen is active and not protected. I get a "BorderAround method of Range class failed" error. I can use 4 lines to set the border on the edges, but I want to understand this. I'm running xl2003 in XP, if that matters. Thanks, John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Clear BorderAround in VBA | Excel Discussion (Misc queries) | |||
OpenText Method failure | Excel Programming | |||
GoalSeek Method failure | Excel Programming | |||
Select method of Range class failure | Excel Programming | |||
Error Method Cell of object global failure | Excel Programming |