Value of first column in active row in ListObject

Stevenn

Active Member
Joined
Feb 8, 2012
Messages
259
I want the value of the first column in the active row in a ListObject.

I've tried
Code:
MsgBox ActiveCell.ListObject.ListRows(ActiveCell.Row).Range.Address
, but don't know how to refer to the first column in this row. I've also tried
Code:
MsgBox ActiveCell.ListObject.ListRows(ActiveCell.Row).ListColumns(1).Range.Value
, but it returns an error message.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
I would think this would work:

Code:
MsgBox ActiveCell.ListObject.ListRows(ActiveCell.Row).Range.Columns(1).Value

There may well be easier ways to do it though
 
Upvote 0
What does

MsgBox Activecell.ListObject.Range.Address

return? Possibly it is not returning what you want because your listobject does not start in row 1? Then:

Code:
With ActiveCell.ListObject
  MsgBox .ListRows(ActiveCell.Row - .Range.Row + 1).Range.Columns(1).Value
End With
 
Upvote 0

Forum statistics

Threads
1,215,463
Messages
6,124,963
Members
449,200
Latest member
indiansth

We've detected that you are using an adblocker.

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.
Go back
Back
Top