C Cuperman007 Nov 26, 2007 #1 Hi All, Is it possible to access my worksheet Lists in VBA? ("proper" Excel lists) Thanks Mark
C Cuperman007 Nov 26, 2007 #3 "Proper" Excel List: Right click a range, click Create List http://office.microsoft.com/en-us/excel/HA010929681033.aspx What I am after is a clean way to be able to loop though a list and consume each entry as an object Something like: For Each Item in List 'do stuff Next Thanks, Mark
"Proper" Excel List: Right click a range, click Create List http://office.microsoft.com/en-us/excel/HA010929681033.aspx What I am after is a clean way to be able to loop though a list and consume each entry as an object Something like: For Each Item in List 'do stuff Next Thanks, Mark
C Chip Pearson Nov 26, 2007 #4 Try Sub AAA() Dim RR As Range Dim LL As Excel.ListObject Dim WS As Worksheet Dim R As Range Set WS = ActiveSheet Set LL = WS.ListObjects("List1") Set RR = LL.DataBodyRange For Each R In RR Debug.Print R.Address(False, False), R.Text Next R End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel, 10 Years Pearson Software Consulting www.cpearson.com (email on the web site)
Try Sub AAA() Dim RR As Range Dim LL As Excel.ListObject Dim WS As Worksheet Dim R As Range Set WS = ActiveSheet Set LL = WS.ListObjects("List1") Set RR = LL.DataBodyRange For Each R In RR Debug.Print R.Address(False, False), R.Text Next R End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel, 10 Years Pearson Software Consulting www.cpearson.com (email on the web site)