Is there any way in a Excel VB macro where in column A there is data in most cells and, in the cells that are blank the data is in column B to delete the blank column A Cells, which in turn will shift left the data from column B cells – Ending up with all the data in column A and no blank cells. Ready for the VLOOKUP function.
For example:
[TABLE="width: 155"]
<tbody>[TR]
[TD]before
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]col A
[/TD]
[TD]col B
[/TD]
[/TR]
[TR]
[TD]apples
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]pears
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]oranges
[/TD]
[/TR]
[TR]
[TD]bananas
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]grapes
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]mangos
[/TD]
[/TR]
[TR]
[TD]strawberries
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]after
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]col A
[/TD]
[TD]col B
[/TD]
[/TR]
[TR]
[TD]apples
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]pears
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]oranges
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]bananas
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]grapes
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]mangos
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]strawberries
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
For example:
[TABLE="width: 155"]
<tbody>[TR]
[TD]before
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]col A
[/TD]
[TD]col B
[/TD]
[/TR]
[TR]
[TD]apples
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]pears
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]oranges
[/TD]
[/TR]
[TR]
[TD]bananas
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]grapes
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]mangos
[/TD]
[/TR]
[TR]
[TD]strawberries
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]after
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]col A
[/TD]
[TD]col B
[/TD]
[/TR]
[TR]
[TD]apples
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]pears
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]oranges
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]bananas
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]grapes
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]mangos
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]strawberries
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]