I am currently working on a dataset that is formatted as a table with headers. What I need to do is loop through all the cells in a specific column and change the contents. Thanks to MSDN research, I came up with the following for the loop
for i = 1 to NumRows Cells(i,23).Value = "PHEV" next i
Thus, this will change all the cells in column 23 to "PHEV". However, I am not creating a table in which I work on my own, so I cannot guarantee that the column of interest will be column 23.
I would like to implement something similar to the following:
for i = 1 to NumRows Cells(i,[@[columnHeader]]).Value = "PHEV" next i
Of course, I know that this syntax is incorrect, but I hope it illustrates my purpose sufficiently.
source share