chadski778
Active Member
- Joined
- Mar 14, 2010
- Messages
- 297
Is it possible to use VBA code to select a table in a worksheet? There is only one table in the worksheet
Sub FindAllTablesOnSheet()
Dim oSh As Worksheet
Dim oLo As ListObject
Set oSh = ActiveSheet
For Each oLo In oSh.ListObjects
Application.Goto oLo.Range
MsgBox "Table found: " & oLo.Name & ", " & oLo.Range.Address
Next
End Sub
The code that Chris posted will display the name and address of each Table or "Listbox" object in the ActiveSheet. If you aren't getting any result, your table is probably not a "Listbox" object, but rather a standard range that has headers and data below it.