Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default BorderAround method failure

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default BorderAround method failure

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default BorderAround method failure

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default BorderAround method failure

Got it! It was being protected by errant code. Thanks.

John

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default BorderAround method failure

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
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
Clear BorderAround in VBA EagleOne Excel Discussion (Misc queries) 16 December 7th 06 02:16 PM
OpenText Method failure Bryan Dickerson Excel Programming 9 April 13th 05 09:29 PM
GoalSeek Method failure Fixit_Steve[_2_] Excel Programming 0 January 17th 05 09:55 PM
Select method of Range class failure Stuart[_5_] Excel Programming 3 February 24th 04 06:35 PM
Error Method Cell of object global failure Marilyn[_3_] Excel Programming 1 December 4th 03 06:13 PM


All times are GMT +1. The time now is 10:09 PM.

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"