Reputation: 1011
This one has me stumped. When I set the formula for a selected cell in a ListObject, if the ListColumn is empty, Excel fills the formula for the whole column, rather than just the Selection. I have duplicated this in a separate workbook.
Execute the following code:
Sub setCellFormula() Selection.Formula = "=myFormula()" End Sub
Function myFormula() As Integer myFormula = 1 End Function
Note that the whole column is filled with the numeral one
Upvotes: 0
Views: 1379
Reputation: 27478
My experience is that, regardless of VBA, Tables behave as you have described in XL 2007, and Lists behave as you'd prefer in XL 2003. However in 2007 you can tell it to "stop creating calculated columns." So I'd guess it's not a code issue, but an issue due to different behavior between versions, or different settings for two instances of XL 2007.
Upvotes: 4