Consulting

Results 1 to 4 of 4

Thread: Help putting border around a range

  1. #1
    VBAX Newbie
    Joined
    Feb 2016
    Posts
    2
    Location

    Help putting border around a range

    I am trying to write code to put a thick border around a range of cells. However, I am getting an error (Expected: =) with the below line of code.

    Can anyone help please?

    Range("A2:G5").BorderAround(Weight:=xlThick, ColorIndex:=5)

  2. #2
    VBAX Expert
    Joined
    Aug 2004
    Posts
    810
    Location
    give this a kick
    Range("A2:G5").BorderAround , xlThick, ColorIndex:=5

  3. #3
    VBAX Newbie
    Joined
    Feb 2016
    Posts
    2
    Location
    That fixed it! Thank you!!

    Quote Originally Posted by JKwan View Post
    give this a kick
    Range("A2:G5").BorderAround , xlThick, ColorIndex:=5

  4. #4
    VBAX Expert
    Joined
    Aug 2004
    Posts
    810
    Location
    If you wanted to keep it as a FUNCTION then you should do this
    Whatever = Range("A2:G5").BorderAround(Weight:=xlThick, ColorIndex:=5)

Posting Permissions

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