Would like to apply a table style to a range of worksheets, I get a "Compile error: no sub or function not defined." error when I run this code.
The tables have identical number of columns with varying rows. The all start at A1.
The tables have identical number of columns with varying rows. The all start at A1.
Code:
Sub ChangeStyle()
Dim x As Integer
For x = 6 To Worksheets.Count
With Workheets(x)
.ListObjects.Add(xlSrcRange, .Range("$A$1"), , xlYes).Name = "Table" & x
.ListObjects("Table" & x).TableStyle = "TableStyleMedium10"
End With
Next x
End Sub