Hi Team,
Hope anyone can help me, I have column heading fields like New, Old, Exist, Duplicate and each column has its own values and require vba code to get each line separately. For example for product A, if you have value in New and Duplicate amounting $1000 and $2000 respectively then it shows in single line in both columns but I should be two different columns saying one for New and other for Duplicate.
Example:
Input data
[TABLE="width: 399"]
<colgroup><col><col span="4"></colgroup><tbody>[TR]
[TD]Product Name
[/TD]
[TD]New[/TD]
[TD]Old[/TD]
[TD]Exists[/TD]
[TD]Duplicate[/TD]
[/TR]
[TR]
[TD]Product 1
[/TD]
[TD] $ 1,000[/TD]
[TD] $ - [/TD]
[TD] $ 100[/TD]
[TD] $ 10[/TD]
[/TR]
[TR]
[TD]Product 2[/TD]
[TD] $ 2,000[/TD]
[TD] $ 20[/TD]
[TD] $ - [/TD]
[TD] $ - [/TD]
[/TR]
[TR]
[TD]Product 3[/TD]
[TD] $ 300[/TD]
[TD] $ 500[/TD]
[TD] $ 1,000[/TD]
[TD] $ 100[/TD]
[/TR]
[TR]
[TD]Product 4[/TD]
[TD] $ 1,000[/TD]
[TD] $ 250[/TD]
[TD] $ 350[/TD]
[TD] $ 500
[/TD]
[/TR]
</tbody>[/TABLE]
Output:
[TABLE="width: 243"]
<colgroup><col><col span="2"></colgroup><tbody>[TR]
[TD]Product Name
[/TD]
[TD]Type[/TD]
[TD]Amount[/TD]
[/TR]
[TR]
[TD]Product 1[/TD]
[TD]New[/TD]
[TD] $ 1,000[/TD]
[/TR]
[TR]
[TD]Product 1[/TD]
[TD]Exists[/TD]
[TD] $ 100
[/TD]
[/TR]
[TR]
[TD]Product 1[/TD]
[TD]Duplicate[/TD]
[TD] $ 10[/TD]
[/TR]
[TR]
[TD]Product 2[/TD]
[TD]New[/TD]
[TD] $ 2,000[/TD]
[/TR]
[TR]
[TD]Product 2
[/TD]
[TD]Old[/TD]
[TD] $ 20[/TD]
[/TR]
[TR]
[TD]Product 3
[/TD]
[TD]New[/TD]
[TD] $ 300[/TD]
[/TR]
[TR]
[TD]Product 3[/TD]
[TD]Old[/TD]
[TD] $ 500[/TD]
[/TR]
[TR]
[TD]Product 3
[/TD]
[TD]Exists[/TD]
[TD] $ 1,000[/TD]
[/TR]
[TR]
[TD]Product 3
[/TD]
[TD]Duplicate[/TD]
[TD] $ 100[/TD]
[/TR]
[TR]
[TD]Product 4
[/TD]
[TD]New[/TD]
[TD] $ 1,000[/TD]
[/TR]
[TR]
[TD]Product 4[/TD]
[TD]Old
[/TD]
[TD] $ 250[/TD]
[/TR]
[TR]
[TD]Product 4[/TD]
[TD]Exists[/TD]
[TD] $ 350[/TD]
[/TR]
[TR]
[TD]Product 4[/TD]
[TD]Duplicate[/TD]
[TD] $ 500
[/TD]
[/TR]
</tbody>[/TABLE]
Thank you,
Hope anyone can help me, I have column heading fields like New, Old, Exist, Duplicate and each column has its own values and require vba code to get each line separately. For example for product A, if you have value in New and Duplicate amounting $1000 and $2000 respectively then it shows in single line in both columns but I should be two different columns saying one for New and other for Duplicate.
Example:
Input data
[TABLE="width: 399"]
<colgroup><col><col span="4"></colgroup><tbody>[TR]
[TD]Product Name
[/TD]
[TD]New[/TD]
[TD]Old[/TD]
[TD]Exists[/TD]
[TD]Duplicate[/TD]
[/TR]
[TR]
[TD]Product 1
[/TD]
[TD] $ 1,000[/TD]
[TD] $ - [/TD]
[TD] $ 100[/TD]
[TD] $ 10[/TD]
[/TR]
[TR]
[TD]Product 2[/TD]
[TD] $ 2,000[/TD]
[TD] $ 20[/TD]
[TD] $ - [/TD]
[TD] $ - [/TD]
[/TR]
[TR]
[TD]Product 3[/TD]
[TD] $ 300[/TD]
[TD] $ 500[/TD]
[TD] $ 1,000[/TD]
[TD] $ 100[/TD]
[/TR]
[TR]
[TD]Product 4[/TD]
[TD] $ 1,000[/TD]
[TD] $ 250[/TD]
[TD] $ 350[/TD]
[TD] $ 500
[/TD]
[/TR]
</tbody>[/TABLE]
Output:
[TABLE="width: 243"]
<colgroup><col><col span="2"></colgroup><tbody>[TR]
[TD]Product Name
[/TD]
[TD]Type[/TD]
[TD]Amount[/TD]
[/TR]
[TR]
[TD]Product 1[/TD]
[TD]New[/TD]
[TD] $ 1,000[/TD]
[/TR]
[TR]
[TD]Product 1[/TD]
[TD]Exists[/TD]
[TD] $ 100
[/TD]
[/TR]
[TR]
[TD]Product 1[/TD]
[TD]Duplicate[/TD]
[TD] $ 10[/TD]
[/TR]
[TR]
[TD]Product 2[/TD]
[TD]New[/TD]
[TD] $ 2,000[/TD]
[/TR]
[TR]
[TD]Product 2
[/TD]
[TD]Old[/TD]
[TD] $ 20[/TD]
[/TR]
[TR]
[TD]Product 3
[/TD]
[TD]New[/TD]
[TD] $ 300[/TD]
[/TR]
[TR]
[TD]Product 3[/TD]
[TD]Old[/TD]
[TD] $ 500[/TD]
[/TR]
[TR]
[TD]Product 3
[/TD]
[TD]Exists[/TD]
[TD] $ 1,000[/TD]
[/TR]
[TR]
[TD]Product 3
[/TD]
[TD]Duplicate[/TD]
[TD] $ 100[/TD]
[/TR]
[TR]
[TD]Product 4
[/TD]
[TD]New[/TD]
[TD] $ 1,000[/TD]
[/TR]
[TR]
[TD]Product 4[/TD]
[TD]Old
[/TD]
[TD] $ 250[/TD]
[/TR]
[TR]
[TD]Product 4[/TD]
[TD]Exists[/TD]
[TD] $ 350[/TD]
[/TR]
[TR]
[TD]Product 4[/TD]
[TD]Duplicate[/TD]
[TD] $ 500
[/TD]
[/TR]
</tbody>[/TABLE]
Thank you,
Last edited: