+ Reply to Thread
Results 1 to 5 of 5

Thread: One to Many VBA code needed

  1. #1
    Registered User
    Join Date
    02-09-2011
    Location
    Portland, oregon
    MS-Off Ver
    Excel 2007
    Posts
    16

    Thumbs up One to Many VBA code needed

    Okay experts, really need some help on this one. I made an example sheet of what I need and attached it. Here is how it needs to work:

    (obviously this is just an example)

    user selects a letter from A-I in the Letters column.
    user selects a number from 1-9 in the numbers column.
    user chooses yes/no in yes/no column and enters in comments in comments column.

    Easy enough.

    Now when they get into the Vegetables column it brings up a small form that I want them to be able to select a vegetable and the quantity and click submit (this will fill in the vegetable column and the qty column). Now, each time they do this it inserts a NEW row below the one they entered and auto fills the above data into the next line for me, only entering a new vegetable and qty.

    In other words, for every letter/number combo there may be several vegetables/qty's selected. On the vegetable form, once they are done they will click DONE.

    I found bits and pieces of code of what I needed, but not enough to put it all together. I am sure for someone out there, this is a simple exercise

    Perhaps there is a better way to do this? Just need ability to have multiple "vegetables" per "letter" and make it so user doesnt have to keep entering same data over and over for every vegetable/qty they enter.



    Thanks for your time, I appreciate you all!!!
    Attached Files Attached Files
    Last edited by pjkeady; 05-26-2011 at 05:27 PM.

  2. #2
    Valued Forum Contributor tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    USA
    MS-Off Ver
    Excel 2003 - 2007
    Posts
    2,352

    Re: One to Many VBA code needed

    pjkeady,

    See attached. Is that what you're looking for?

    ~tigeravatar
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-09-2011
    Location
    Portland, oregon
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: One to Many VBA code needed

    Hi Tiger, thanks for the reply. Almost ... that solves the big problem. Only thing missing is the other fields (cells) should repeat for each line entered. So in your example there would be two letter a's number 1's etc. instead of blanks in a3:d3. same with b etc.

    thanks again

  4. #4
    Valued Forum Contributor tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    USA
    MS-Off Ver
    Excel 2003 - 2007
    Posts
    2,352

    Re: One to Many VBA code needed

    pjkeady,

    v2 attached with the requested change.

    ~tigeravatar
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-09-2011
    Location
    Portland, oregon
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: One to Many VBA code needed

    awesome thanks!!!! that answers my question!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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