PDA

View Full Version : Help putting border around a range



aerider
02-17-2016, 07:44 AM
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)

JKwan
02-17-2016, 08:00 AM
give this a kick


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

aerider
02-17-2016, 08:05 AM
That fixed it! Thank you!!


give this a kick


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

JKwan
02-17-2016, 08:21 AM
If you wanted to keep it as a FUNCTION then you should do this


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