I'm relatively new to VBA and I'm trying to write a code that will look at the receiving person column for Peter and will replace the Target Person and Target Fruit columns to match what's in the Sending Person and Sending Fruit.
I used this thread here to figure out the code, but that thread is looking values for different sheets. All of my data is in the same sheet, same rows, but different columns.
Raw Data:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Sending Person[/TD]
[TD]Sending Fruit[/TD]
[TD]Receiving Person[/TD]
[TD]Receiving Fruit[/TD]
[TD]Target Person[/TD]
[TD]Target Fruit[/TD]
[/TR]
[TR]
[TD]George[/TD]
[TD]Strawberries[/TD]
[TD]Peter[/TD]
[TD]Jackfruit[/TD]
[TD]Amy[/TD]
[TD]Blackberries[/TD]
[/TR]
[TR]
[TD]Kelsey[/TD]
[TD]Blueberries[/TD]
[TD]Peter[/TD]
[TD]Jackfruit[/TD]
[TD]Keith[/TD]
[TD]Grapes[/TD]
[/TR]
</tbody>[/TABLE]
Should Be:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Sending Person[/TD]
[TD]Sending Fruit[/TD]
[TD]Receiving Person[/TD]
[TD]Receiving Fruit[/TD]
[TD]Target Person[/TD]
[TD]Target Fruit[/TD]
[/TR]
[TR]
[TD]George[/TD]
[TD]Strawberries[/TD]
[TD]Peter[/TD]
[TD]Jackfruit[/TD]
[TD]George[/TD]
[TD]Strawberries[/TD]
[/TR]
[TR]
[TD]Kelsey[/TD]
[TD]Blueberries[/TD]
[TD]Peter[/TD]
[TD]Jackfruit[/TD]
[TD]Kelsey[/TD]
[TD]Blueberries[/TD]
[/TR]
</tbody>[/TABLE]
Any help would be appreciated.
I used this thread here to figure out the code, but that thread is looking values for different sheets. All of my data is in the same sheet, same rows, but different columns.
Raw Data:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Sending Person[/TD]
[TD]Sending Fruit[/TD]
[TD]Receiving Person[/TD]
[TD]Receiving Fruit[/TD]
[TD]Target Person[/TD]
[TD]Target Fruit[/TD]
[/TR]
[TR]
[TD]George[/TD]
[TD]Strawberries[/TD]
[TD]Peter[/TD]
[TD]Jackfruit[/TD]
[TD]Amy[/TD]
[TD]Blackberries[/TD]
[/TR]
[TR]
[TD]Kelsey[/TD]
[TD]Blueberries[/TD]
[TD]Peter[/TD]
[TD]Jackfruit[/TD]
[TD]Keith[/TD]
[TD]Grapes[/TD]
[/TR]
</tbody>[/TABLE]
Should Be:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Sending Person[/TD]
[TD]Sending Fruit[/TD]
[TD]Receiving Person[/TD]
[TD]Receiving Fruit[/TD]
[TD]Target Person[/TD]
[TD]Target Fruit[/TD]
[/TR]
[TR]
[TD]George[/TD]
[TD]Strawberries[/TD]
[TD]Peter[/TD]
[TD]Jackfruit[/TD]
[TD]George[/TD]
[TD]Strawberries[/TD]
[/TR]
[TR]
[TD]Kelsey[/TD]
[TD]Blueberries[/TD]
[TD]Peter[/TD]
[TD]Jackfruit[/TD]
[TD]Kelsey[/TD]
[TD]Blueberries[/TD]
[/TR]
</tbody>[/TABLE]
Any help would be appreciated.