Objective: to create a VBA auto-generated script from data elements within a series of cells
Data elements (Target Name starting at B1):
A B C
[TABLE="width: 398"]
<colgroup><col><col span="2"></colgroup><tbody>[TR]
[TD]Target Name[/TD]
[TD]J RMC[/TD]
[TD]Pohnson LMC[/TD]
[/TR]
[TR]
[TD]Alias Names[/TD]
[TD]Johnson RMC[/TD]
[TD]Pohnson LMCs[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Johnson Rock Mine Corp[/TD]
[TD]Pohnson Lock Mine CoLp[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Johnson RM Corp[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]J RMC[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Johnson R Mine C[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I would like to take all columns that have data in them like the above with varying lengths and generate a script below (I will then copy/paste this later):
Thank you in advance for any help.
Data elements (Target Name starting at B1):
A B C
[TABLE="width: 398"]
<colgroup><col><col span="2"></colgroup><tbody>[TR]
[TD]Target Name[/TD]
[TD]J RMC[/TD]
[TD]Pohnson LMC[/TD]
[/TR]
[TR]
[TD]Alias Names[/TD]
[TD]Johnson RMC[/TD]
[TD]Pohnson LMCs[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Johnson Rock Mine Corp[/TD]
[TD]Pohnson Lock Mine CoLp[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Johnson RM Corp[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]J RMC[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Johnson R Mine C[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I would like to take all columns that have data in them like the above with varying lengths and generate a script below (I will then copy/paste this later):
Code:
If [automfg]="J RMC" or [automfg]="Johnson RMC" or [automfg]="Johnson Rock Mine Corp" or [automfg]="Johnson RM Corp" or "J RMC" or [automfg]="Johnson R Mine C"
then "J RMC"
elseif [automfg]="Pohnson LMC" or [automfg]="Pohnson LMCs" or [automfg]="Pohnson Lock Mine CoLp"
then "Phonson LMC"
end
Thank you in advance for any help.