Good Morning
The following code gives me a runtime error 1004. If I take out the reference to the sheet, it works, but on the active sheet. I don't really want to activate the sheet first, because the macro alternates between two worksheets quite frequently. Is there a way of doing this without selecting the sheet first?
The following code gives me a runtime error 1004. If I take out the reference to the sheet, it works, but on the active sheet. I don't really want to activate the sheet first, because the macro alternates between two worksheets quite frequently. Is there a way of doing this without selecting the sheet first?
Code:
With Sheets("Leave Summary").Range(Cells(LeaveHeader, 1), Cells(LeaveHeader, 4)).Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
End With