Dim intCounter As Integer
Dim j As Integer
j = Worksheets("Graph Data").Range("C9")
For intCounter = 0 To j
If IsEmpty(Worksheets("Graph Data").Cells(9 + intCounter, 5).Value) = "True" Then
With Worksheets("Graph Data")
.Range(Cells(9 + intCounter, 3), Cells(9 + intCounter, 11)).Borders(xlEdgeLeft).Weight = xlThick
.Range(Cells(9 + intCounter, 3), Cells(9 + intCounter, 11)).Borders(xlEdgeBottom).Weight = xlThick
.Range(Cells(9 + intCounter, 3), Cells(9 + intCounter, 11)).Borders(xlEdgeRight).Weight = xlThick
.Range(Cells(9 + intCounter, 3), Cells(9 + intCounter, 11)).Borders(xlInsideVertical).Weight = xlThin
End With
End If
Next intCounter
Using the exact same code, but on an ACTIVE worksheet, it works just fine. Trying to reference an inactive worksheet breaks everything. Why? How can I go about avoiding this?
All this is doing is incrementing the border around a table of data in another worksheet when a macro populates data on the current active worksheet. This functionality NEEDS to be a part of the macro that populates data on the current worksheet. It cannot be separated.
Thank you for your time.
P.S.: If you have a way of making all of these borders occur within one line of code, feel free to advise. Thank you.