Does table have at least one row in Excel 2007?

N

nickol

When I create a table with no data rows, Excel adds one empty row for me, and
I cannot delete it. If the row has data, deleting it only deletes data, not
the row.
But in Excel 2003, a table can have 0 data row. Is it a design change? Where
can I find documentation on it?
 
R

Roger Govier

Hi
The behaviour has not altered.
In Excel 2003 it is called a list not a Table.
Data>list>Create will add one blank row to the List (table)
In Excel 2007
Insert tab>Table creates a Table with one blank row
 
N

nickol

Hi Roger,

In Excel 2003, the blank row added is an insert row (with a '*'), not data
row.
Type in it will insert a new row.
In Excel 2007, there is no insert row. The new added row is a data row.
 
R

Roger Govier

Hi Nick

Regardless of the appearance, (asterisk versus plain cell) the number of
rows in the List / Table is identical

sub testrowcount()
dim myList as Object
Set mylist = ActiveSheet.ListObjects
If mylist.Count Then ' A List or Table Object is present
With mylist(1)
Debug.Print .ListRows.Count
Debug.Print .ListColumns.Count
End With
End if
End sub

This returns the same number of Rows for the XL2007 Table as it does for the
XL2003 List,
which is 0 if there is only a header row
 
N

nickol

Hi Roger,

Yes the code proves your idea.
I can think the blank row in 2007 is similar to the insert row(asterisk) in
2003.

Thank you for your reply!
Nick
 
Top