abbab
04-03-2013, 12:40 PM
Hello,
I have a VBA code to generate a table in Excel as follows:
If ActiveSheet.AutoFilterMode = True Then ActiveSheet.AutoFilterMode = False
Range("R1:Y8").Select
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$R$1:$Y$8"), , xlYes).Name = _
"Table1"
ActiveSheet.ListObjects("Table1").TableStyle = "TableStyleMedium2"
However, after the table is created with headers such as those in the top half of the attached image. I'd like to be able to create something like those in the bottom half of the attached image instead.
Is there anyway to do this without having the filters generate and then going back and modifying the contents of the cells? I'd like to prevent the filters from being inserted in the table in the first place if that is possible. And I would like to keep all of the other formatting.
Thanks in advance for your assistance with this!
Amy
I have a VBA code to generate a table in Excel as follows:
If ActiveSheet.AutoFilterMode = True Then ActiveSheet.AutoFilterMode = False
Range("R1:Y8").Select
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$R$1:$Y$8"), , xlYes).Name = _
"Table1"
ActiveSheet.ListObjects("Table1").TableStyle = "TableStyleMedium2"
However, after the table is created with headers such as those in the top half of the attached image. I'd like to be able to create something like those in the bottom half of the attached image instead.
Is there anyway to do this without having the filters generate and then going back and modifying the contents of the cells? I'd like to prevent the filters from being inserted in the table in the first place if that is possible. And I would like to keep all of the other formatting.
Thanks in advance for your assistance with this!
Amy