I am trying to write something that will loop through a range of non-contiguous rows in a table, and change column data in each row ... for example, ClearContents. The range will be dynamic, and the rows I want to loop through will all be "Selected."
I tried the following, but it stopped after the first row. I am pretty sure the problem is that the next row is non-contiguous to the first row:
For Each b In a.Rows
mainTasks.DataBodyRange(Range("mainTasks[Status]").Column).ClearContents
Next b
Then I had the bright idea to write something that works only the "selected" column cells. I tried using If ... .Value = Selected and that didn't work.
Am I trying to do something that Excel 2016 VBA can't do? That is, loop through non-contiguous rows in a range? I've been researching and tried several other things that don't work. Can you tell me if I am going down the wrong rabbit hole?