Hello,
First time poster, long time reader.
I'm trying to figure out a way using VBA where a user can specify values in 2 adjacent cells with a quantity in a 3rd cell, hit a button and have it insert the values entered a number of times equal to the quantity specified.
Example Input:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD="align: center"]Product[/TD]
[TD="align: center"]Price[/TD]
[TD="align: center"]QTY[/TD]
[/TR]
[TR]
[TD="align: center"]Dog Socks[/TD]
[TD="align: center"]$2.95[/TD]
[TD="align: center"]4[/TD]
[/TR]
[TR]
[TD="align: center"]Cat Mittens[/TD]
[TD="align: center"]$1.99[/TD]
[TD="align: center"]4[/TD]
[/TR]
</tbody>[/TABLE]
Example Output:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD="align: center"]Product[/TD]
[TD="align: center"]Price
[/TD]
[/TR]
[TR]
[TD="align: center"]Dog Socks[/TD]
[TD="align: center"]$2.95[/TD]
[/TR]
[TR]
[TD="align: center"]Dog Socks[/TD]
[TD="align: center"]$2.95[/TD]
[/TR]
[TR]
[TD="align: center"]Dog Socks[/TD]
[TD="align: center"]$2.95[/TD]
[/TR]
[TR]
[TD="align: center"]Dog Socks[/TD]
[TD="align: center"]$2.95[/TD]
[/TR]
[TR]
[TD="align: center"]Cat Mittens[/TD]
[TD="align: center"]$1.99[/TD]
[/TR]
[TR]
[TD="align: center"]Cat Mittens[/TD]
[TD="align: center"]$1.99[/TD]
[/TR]
[TR]
[TD="align: center"]Cat Mittens[/TD]
[TD="align: center"]$1.99[/TD]
[/TR]
[TR]
[TD="align: center"]Cat Mittens[/TD]
[TD="align: center"]$1.99[/TD]
[/TR]
</tbody>[/TABLE]
The actual product list has 50+ products and the prices can vary so using formulas isn't ideal. There can also be up to 30 different types of product per order. I figure the best approach is using VBA and having the output values specified by the user, then executing it based on the # entered into the quantity, and outputting the values into the "next empty cell" on the output sheet.
I made a sample workbook, but I don't see a way to attach it.
First time poster, long time reader.
I'm trying to figure out a way using VBA where a user can specify values in 2 adjacent cells with a quantity in a 3rd cell, hit a button and have it insert the values entered a number of times equal to the quantity specified.
Example Input:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD="align: center"]Product[/TD]
[TD="align: center"]Price[/TD]
[TD="align: center"]QTY[/TD]
[/TR]
[TR]
[TD="align: center"]Dog Socks[/TD]
[TD="align: center"]$2.95[/TD]
[TD="align: center"]4[/TD]
[/TR]
[TR]
[TD="align: center"]Cat Mittens[/TD]
[TD="align: center"]$1.99[/TD]
[TD="align: center"]4[/TD]
[/TR]
</tbody>[/TABLE]
Example Output:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD="align: center"]Product[/TD]
[TD="align: center"]Price
[/TD]
[/TR]
[TR]
[TD="align: center"]Dog Socks[/TD]
[TD="align: center"]$2.95[/TD]
[/TR]
[TR]
[TD="align: center"]Dog Socks[/TD]
[TD="align: center"]$2.95[/TD]
[/TR]
[TR]
[TD="align: center"]Dog Socks[/TD]
[TD="align: center"]$2.95[/TD]
[/TR]
[TR]
[TD="align: center"]Dog Socks[/TD]
[TD="align: center"]$2.95[/TD]
[/TR]
[TR]
[TD="align: center"]Cat Mittens[/TD]
[TD="align: center"]$1.99[/TD]
[/TR]
[TR]
[TD="align: center"]Cat Mittens[/TD]
[TD="align: center"]$1.99[/TD]
[/TR]
[TR]
[TD="align: center"]Cat Mittens[/TD]
[TD="align: center"]$1.99[/TD]
[/TR]
[TR]
[TD="align: center"]Cat Mittens[/TD]
[TD="align: center"]$1.99[/TD]
[/TR]
</tbody>[/TABLE]
The actual product list has 50+ products and the prices can vary so using formulas isn't ideal. There can also be up to 30 different types of product per order. I figure the best approach is using VBA and having the output values specified by the user, then executing it based on the # entered into the quantity, and outputting the values into the "next empty cell" on the output sheet.
I made a sample workbook, but I don't see a way to attach it.