![]() |
Counting using a form
I've created a user form where they select a product and input associated
quantity, weight, and value. There is an "Add to Tally" button that should cause the form to accept the amounts into variables and then clear the form for the next order in the consolidation. The same product may show up several times at different quantities, weights, and values, adding to the tally each time. When the user is done collecting the consolidation information, there is a second button which should output the totals to specific fields in my spreadsheet and reset the variables to 0 for the next order consolidation. I'm having my problems in creating this counting mechanism because I don't know if I need to build an array (or how to do it) or 3 variables for each of the 13 products and how to keep the tally. Any ideas and/or code snippets would be greatly appreciated. |
Counting using a form
I would think about just adding the new values to the specific cells
when they hit the "Add to Tally" button. If you have a row for each order and a column for each product... cells(orderNumber,productNumber) = cells(orderNumber,productNumber) + me.textBox.value AB wrote: I've created a user form where they select a product and input associated quantity, weight, and value. There is an "Add to Tally" button that should cause the form to accept the amounts into variables and then clear the form for the next order in the consolidation. The same product may show up several times at different quantities, weights, and values, adding to the tally each time. When the user is done collecting the consolidation information, there is a second button which should output the totals to specific fields in my spreadsheet and reset the variables to 0 for the next order consolidation. I'm having my problems in creating this counting mechanism because I don't know if I need to build an array (or how to do it) or 3 variables for each of the 13 products and how to keep the tally. Any ideas and/or code snippets would be greatly appreciated. |
Counting using a form
Great suggestion. I had to tweak it a bit, but you pointed me in the right
direction. Thank you. -AB " wrote: I would think about just adding the new values to the specific cells when they hit the "Add to Tally" button. If you have a row for each order and a column for each product... cells(orderNumber,productNumber) = cells(orderNumber,productNumber) + me.textBox.value AB wrote: I've created a user form where they select a product and input associated quantity, weight, and value. There is an "Add to Tally" button that should cause the form to accept the amounts into variables and then clear the form for the next order in the consolidation. The same product may show up several times at different quantities, weights, and values, adding to the tally each time. When the user is done collecting the consolidation information, there is a second button which should output the totals to specific fields in my spreadsheet and reset the variables to 0 for the next order consolidation. I'm having my problems in creating this counting mechanism because I don't know if I need to build an array (or how to do it) or 3 variables for each of the 13 products and how to keep the tally. Any ideas and/or code snippets would be greatly appreciated. |
All times are GMT +1. The time now is 12:30 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com