jmcginley3
New Member
- Joined
- Mar 28, 2018
- Messages
- 14
I'm trying to figure out how I can use Cells.Replace along with Offset to locate and replace the cells that contain the text "Auto Adjustments" and replace it with the value of the cell directly above it.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]450[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Auto Adjustments[/TD]
[TD]<--- this Cell is changed to the value of the cell right above it (450)[/TD]
[/TR]
[TR]
[TD]564[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]45433[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]56788[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9084[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Auto Adjustments[/TD]
[TD]<---- this Cell is changed to the value of the cell right above it (9084)[/TD]
[/TR]
[TR]
[TD]56165[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8765[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Auto Adjustments[/TD]
[TD]<---- this Cell is changed to the value of the cell right above it (8765)[/TD]
[/TR]
</tbody>[/TABLE]
Can I use this and insert some kind of offset coding into the Replacement?
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]450[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Auto Adjustments[/TD]
[TD]<--- this Cell is changed to the value of the cell right above it (450)[/TD]
[/TR]
[TR]
[TD]564[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]45433[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]56788[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9084[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Auto Adjustments[/TD]
[TD]<---- this Cell is changed to the value of the cell right above it (9084)[/TD]
[/TR]
[TR]
[TD]56165[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8765[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Auto Adjustments[/TD]
[TD]<---- this Cell is changed to the value of the cell right above it (8765)[/TD]
[/TR]
</tbody>[/TABLE]
Can I use this and insert some kind of offset coding into the Replacement?
Code:
Cells.Replace What:="Auto Adjustments", Replacement:="?????", LookAt:= xlPart, SearchOrder:=xlByRows