As sort of a side-bar to the original post, the solution:
Code:
Sub test()
Dim lstObj As ListObject
Dim rColumn As Range
' Get the table reference
Set lstObj = Worksheets("Sheet1").ListObjects("Table1")
' Get the column reference
Set rColumn = lstObj.ListColumns("Field1").DataBodyRange
' display first data value in the column
MsgBox rColumn(1).Value
End Sub
only works if there is data in column "Field1" of the listobject. How can the column be found if there is no data in it?
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.