在我的脚本中,我正在尝试更改表格的标题名称。当我运行我的代码时,它会跳过除最后一列之外的每一列,并且只放置一个名称,我不知道为什么。这是代码:
C = Sheets("Name").Range("B" & Rows.count).End(xlUp).Row
Sheets("Name").ListObjects.Add(xlSrcRange, Range("$A$1:$M$" & C), , xlYes).Name = _
"Table1"
Sheets("Name").ListObjects("Table1").TableStyle = "TableStyleLight9"
hdrs = Array("SUBSYSTEM", "Rack Assumbly", "Rack Number", "PRODUCT/COMPONENT ASSEMBLY NAME", "VERSION#", "OEM", "Part #", "U", "S", "SR", "CI", "TOTAL QUANTITY", "DESCRIPTION")
For h = 0 To 12
Sheets("Name").ListObjects("Table1").HeaderRowRange.Cells(1, 13).Value = hdrs(h)
Next h
h和C是长的。