Hi
Can somebody please help and explain why below code works on a small table (excel 2010) but not on a big table?
in the case of the big table the column gets created but the code starting at oLc.Name gets ignored.
Hope somebody can point me straight on this
cheers
Can somebody please help and explain why below code works on a small table (excel 2010) but not on a big table?
Code:
Sub insCol()
Dim oSh As Worksheet
Dim oLc As ListColumn
Set oSh = ActiveSheet
oSh.ListObjects("Table1").ListColumns(3).Range.Select
Set oLc = Selection.ListObject.ListColumns.Add(3)
oLc.Name = "new header"
oLc.TotalsCalculation = xlTotalsCalculationSum
End Sub
Hope somebody can point me straight on this
cheers