Where to find table information on a spreadsheet

Patricia Timm
Patricia Timm used Ask the Experts™
on
How do I know if a table exists on my spreadsheet? Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Lee W, MVPTechnology and Business Process Advisor
Most Valuable Expert 2013

Commented:
Find?  Really need more information...

Author

Commented:
is there a place where table names are stored and the range in a table on a sheet can be viewed? Thanks

Author

Commented:
got it ... in upper right corner of spreadsheet. How do I change the range of the table to include more rows then table currently is using in a column
Lee W, MVPTechnology and Business Process Advisor
Most Valuable Expert 2013

Commented:
You mean you want to EDIT the Excel file STRUCTURE as opposed to the data in it?  Can you explain what you're trying to accomplish?  Changing a worksheet name or something?  If you explain what you need / why you need it, we may be able to answer your question appropriately.
Martin Liss"There is still no cure for the common birthday." ~John Glenn
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Just add a row and the table will automatically expand.
Subodh Tiwari (Neeraj)Excel & VBA Expert
Most Valuable Expert 2018
Awarded 2015
Commented:
If you want to change the source range of a table, click inside the table and click on the Table Design in the ribbon and then click on Resize Table under the Properties group to change the source range of the table.

TableSource.jpg
Martin Liss"There is still no cure for the common birthday." ~John Glenn
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
And to find out if a table exists on the sheet you can use this macro. Change line 7 to match the name you are looking for.
Sub FindTables()
Dim intT As Integer

With ActiveSheet

    For intT = 1 To .ListObjects.Count
        If .ListObjects(intT).Name = "Table2" Then
            MsgBox ("Found")
            Exit Sub
        End If
    Next
    
    MsgBox "Not found"

End With

End Sub

Open in new window

Tom FarrarConsultant

Commented:
You can also look in Formulas>NameManager, and the ones with the table icon are tables.

Author

Commented:
I have a worksheet where the filter was not picking up the rows when I tried to search for them. The table ended and the rows after the table ended were not being filtered. If I expand the table I can now see the rows.
But my logic is wrong if this is true "Just add a row and the table will automatically expand."
Can someone create a table with boundaries? or maybe created in another version of excel?
Thanks much for the help
"There is still no cure for the common birthday." ~John Glenn
Most Valuable Expert 2017
Distinguished Expert 2018
Commented:
You can also look in Formulas>NameManager, and the ones with the table icon are tables.
I did not realize that!
Martin Liss"There is still no cure for the common birthday." ~John Glenn
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
I misspoke; it's not quite automatic. This is a stripped down version of a macro i wrote that will add a row to a table.

Dim lngLastRow As Long
Dim tbl As ListObject
Set tbl = ActiveSheet.ListObjects("tblHistory")
 
If (Target.Column = 1 Or Target.Column = 2) And Not IsEmpty(Target) Then
    With Sheet2
        lngLastRow = .Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
        .Range("B" & lngLastRow + 1) = Target
        .Range("C" & lngLastRow + 1) = Now
        .ListObjects("tblHistory").Resize .Range("$B$2:$E$" & .UsedRange.Rows.Count)
    End With
End If

Open in new window

Author

Commented:
Any idea why it did not automatically add the row?? thanks again
Martin Liss"There is still no cure for the common birthday." ~John Glenn
Most Valuable Expert 2017
Distinguished Expert 2018
Commented:
Click the blue button in this workbook.
29167276.xlsm

Author

Commented:
thanks
Martin Liss"There is still no cure for the common birthday." ~John Glenn
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
You’re welcome and I’m glad I was able to help.

If you expand the “Full Biography" section of my profile you’ll find links to some articles I’ve written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange Most Valuable Expert (MVE) 2015, 2017
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2018
              Experts Exchange Top Expert VBA 2018
              Experts Exchange Distinguished Expert in Excel 2018

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial