Hi all,
I've done a ton of googling and can't find the answer, so I'm asking the question. I have a worksheet that has several pages that need formatting work that should bee scripted. I want to change a ExternalData_1 to a table so I can give it a different visual format. The problem is when I record the macro to do it, it automatically fills out the range and doesn't give a clue on how to find the range of the ExternalData_1 in order to know how large to make the table. Below is the code from recording a macro:
ActiveSheet.QueryTables("ExternalData_1").Delete
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$B$2:$C$5"), , xlYes).Name = _
"Table10"
Range("Table10[#All]").Select
ActiveSheet.ListObjects("Table10").TableStyle = "TableStyleMedium7"
How do I get the right range to do this in a script since the tables will be different for each sheet in the workbook? Thanks.
I've done a ton of googling and can't find the answer, so I'm asking the question. I have a worksheet that has several pages that need formatting work that should bee scripted. I want to change a ExternalData_1 to a table so I can give it a different visual format. The problem is when I record the macro to do it, it automatically fills out the range and doesn't give a clue on how to find the range of the ExternalData_1 in order to know how large to make the table. Below is the code from recording a macro:
ActiveSheet.QueryTables("ExternalData_1").Delete
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$B$2:$C$5"), , xlYes).Name = _
"Table10"
Range("Table10[#All]").Select
ActiveSheet.ListObjects("Table10").TableStyle = "TableStyleMedium7"
How do I get the right range to do this in a script since the tables will be different for each sheet in the workbook? Thanks.