JasonG
01-19-2018, 10:49 AM
Hi,
Each I have to format my new excel file containing from 10 to 30 worksheets. At this time I have to go each worksheet one by one to format.
Here is a macro what I did in one worksheet7 named "Jason Data":
Sheets("Jason Data").Select
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$C$3"), , xlYes).Name = "Table7"
Range("Table7[#All]").Select
ActiveSheet.ListObjects("Table7").TableStyle = "TableStyleMedium9"
How can I do it by looping all the worksheets and format them in the way above. Starting range is always A1 but ending range will change on each worksheet. Can we use a variable for "Table7"?
In other words, will ActiveSheet.ListObjects(myvariable).TableStyle = "TableStyleMedium9" work?
Best,
Each I have to format my new excel file containing from 10 to 30 worksheets. At this time I have to go each worksheet one by one to format.
Here is a macro what I did in one worksheet7 named "Jason Data":
Sheets("Jason Data").Select
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$C$3"), , xlYes).Name = "Table7"
Range("Table7[#All]").Select
ActiveSheet.ListObjects("Table7").TableStyle = "TableStyleMedium9"
How can I do it by looping all the worksheets and format them in the way above. Starting range is always A1 but ending range will change on each worksheet. Can we use a variable for "Table7"?
In other words, will ActiveSheet.ListObjects(myvariable).TableStyle = "TableStyleMedium9" work?
Best,