Looping through all rows in a table column, Excel-VBA

前端 未结 9 618
予麋鹿
予麋鹿 2020-12-14 19:12

I\'m currently working on a data set which is formatted as a table, with headers. What I need to do is cycle through all cells in a specific column and change the contents.

9条回答
  •  情深已故
    2020-12-14 20:04

    Assuming your table is called "Table1" and your column is called "Column1" then:

    For i = 1 To ListObjects("Table1").ListRows.Count
        ListObjects("Table1").ListColumns("Column1").DataBodyRange(i) = "PHEV"
    Next i
    

提交回复
热议问题