+ Reply to Thread
Results 1 to 3 of 3

Thread: Counting using a form

  1. #1
    AB
    Guest

    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.

  2. #2
    greg.hingsbergen@gmail.com
    Guest

    Re: 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.



  3. #3
    AB
    Guest

    Re: Counting using a form

    Great suggestion. I had to tweak it a bit, but you pointed me in the right
    direction.

    Thank you.

    -AB

    "greg.hingsbergen@gmail.com" 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.

    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0