Originally Posted by
Babydum
So how to I get your suggestions into the code below?
You don't have a selection thingimmigig in there perhaps, but selection is just a range, and you do have a range. If we re-write your code somewhat,
Trainers.Range(Cells(7, i).Address & ":" & Cells(LastRow, i).Address) _
.Borders(xlEdgeRight).LineStyle = xlDouble
Rooms.Range(Cells(7, i).Address & ":" & Cells(LastRow, i).Address) _
.Borders(xlEdgeRight).LineStyle = xlDouble
the first of each pair of lines is the range, and Borders is a property of Range (the good ol' OB again). So you can easily implement with
With Trainers.Range(Cells(7, i).Address & ":" & Cells(LastRow, i).Address)
With .Borders(xlEdgeRight)
.LineStyle = xlDouble
.ColorIndex = 11
End With
End With
With Rooms.Range(Cells(7, i).Address & ":" & Cells(LastRow, i).Address)
With .Borders(xlEdgeRight)
.LineStyle = xlDouble
.ColorIndex = 11
End With
End With
And you can improve the code. These two statements are equivalent
Trainers.Range (Cells(7, i).Address & ":" & Cells(LastRow, i).Address)
Trainers.Range(Cells(7, i), Cells(LastRow, i))
BTW Hope I didn't offend you, just trying to add some levity.
.