+ Reply to Thread
Results 1 to 5 of 5

BorderAround method failure

  1. #1
    johnhildreth@citynet.net
    Guest

    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. #2
    Peter T
    Guest

    Re: 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

    <johnhildreth@citynet.net> wrote in message
    news:1134928996.803840.157980@g49g2000cwa.googlegroups.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. #3
    johnhildreth@citynet.net
    Guest

    Re: 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. #4
    johnhildreth@citynet.net
    Guest

    Re: BorderAround method failure

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

    John


  5. #5
    Peter T
    Guest

    Re: 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


    <johnhildreth@citynet.net> wrote in message
    news:1134930468.884069.141280@g47g2000cwa.googlegroups.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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1