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.
- Create a Table
- Insert a five or so rows
- Click on (select) one of the cells in the column
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
- Delete the data in the cells
- Enter any value in any of the cells
- Select a cell other than the cell with a value in it
- Re-execute step 4
- Note that only the selected cell is filled with the numeral one