I have code below to clear borders and data from Col WE1 to last row containing Data oin Col Z
I get Type mismatch and the code below is highlighted
See full code below
It would be appreciated if someone could kindly amend my code
I get Type mismatch and the code below is highlighted
Code:
With Sheets(WKS)
See full code below
Code:
Sub Clear_Borders_Unwanted()
Dim LR As Long, WKS As Worksheet
For Each WKS In ActiveWorkbook.Worksheets
With Sheets(WKS)
LR = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("E1:Z" & LR).Borders(xlEdgeLeft).LineStyle = xlNone
.Range("E1:Z" & LR).Borders(xlEdgeTop).LineStyle = xlNone
.Range("E1:Z" & LR).Borders(xlEdgeBottom).LineStyle = xlNone
.Range("E1:Z" & LR).Borders(xlEdgeRight).LineStyle = xlNone
.Range("E1:Z" & LR).Borders(xlInsideVertical).LineStyle = xlNone
.Range("E1:Z" & LR).Borders(xlInsideHorizontal).LineStyle = xlNone
.Range("E1:Z" & LR).ClearContents
End With
Next WKS
End Sub
It would be appreciated if someone could kindly amend my code