I am trying to make a personal macro so that whenever I want to change the tablestyle of the table I have the active cell in, it will change it to the style I've designated in my code.
For example:
This code works if the table's name happens to be Table1, but I want to apply the style to the table no matter what the name is.
How can I make this so that the table name is no longer a consideration?
For example:
VBA Code:
Sub OrangeTable()
Range("B4").Select
ActiveSheet.ListObjects("Table1").TableStyle = "TableStyleMedium3"
End Sub
This code works if the table's name happens to be Table1, but I want to apply the style to the table no matter what the name is.
How can I make this so that the table name is no longer a consideration?