spill-the-beans
Board Regular
- Joined
- Feb 7, 2013
- Messages
- 52
Hi 
Each cell in column H of my worksheet "Data" is either a 1 or a 0. I would like to search down the column for a pattern of cells that matches 1, 0, 0, 0, 1, then change those 0s to 1s.
So the data could be:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]H
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]1
[/TD]
[/TR]
</tbody>[/TABLE]
And the code would change it to:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]H
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]1
[/TD]
[/TR]
</tbody>[/TABLE]
Does anyone know how I could do this?

Each cell in column H of my worksheet "Data" is either a 1 or a 0. I would like to search down the column for a pattern of cells that matches 1, 0, 0, 0, 1, then change those 0s to 1s.
So the data could be:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]H
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]1
[/TD]
[/TR]
</tbody>[/TABLE]
And the code would change it to:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]H
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]1
[/TD]
[/TR]
</tbody>[/TABLE]
Does anyone know how I could do this?