+ Reply to Thread
Results 1 to 7 of 7

I don't how to create a macro for my command button

  1. #1
    Registered User
    Join Date
    03-15-2013
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003 / 2007
    Posts
    14

    I don't how to create a macro for my command button

    I have not used excel for quite some time and this is something that I used to be able to do.

    I have two spreadsheets:

    1. Pizza Order Template
    2. Order Master

    The first is a spreadsheet, whereby users can choose a food order using a number of dropdown boxes. Once this has been completed they can use a button to 'submit their order'. Basically what I want is the following to happen upon the button being clicked in Pizza Order Template:

    It would find the first empty row in the order master template and transfer the data in the following cells:

    H2 (pizza order template) copied to cell A1 (order master)
    AC2 (pizza order template) copied to cell A2 (order master)
    H5 (pizza order template) copied to cell A3 (order master)
    AC5 (pizza order template) copied to cell A4 (order master)
    H9 (pizza order template) copied to cell A5 (order master)
    H11 (pizza order template) copied to cell A6 (order master)
    H13 (pizza order template) copied to cell A7 (order master)
    AC9 (pizza order template) copied to cell A8 (order master)
    AC11 (pizza order template) copied to cell A9 (order master)
    AC13 (pizza order template) copied to cell A10 (order master)
    H15 (pizza order template) copied to cell A11 (order master)
    AC15 (pizza order template) copied to cell A12 (order master)
    H17 (pizza order template) copied to cell A13 (order master)
    AC17 (pizza order template) copied to cell A14 (order master)
    H19 (pizza order template) copied to cell A15 (order master)
    AC19 (pizza order template) copied to cell A16 (order master)

    It would then clear the data in the above cells in the pizza order template, ready for the next user to input.

    I would be grateful if anyone could help me with this as I am going round in circles.

    Thanks,

    James
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: I don't how to create a macro for my command button

    The Submit Button is ready, I copied everything to the Order tab and left the Order Template tab alone.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-15-2013
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003 / 2007
    Posts
    14

    Re: I don't how to create a macro for my command button

    Hi, thanks for helping me out.

    Is there anyway you could amend the macro so that the data is transferred into this new order master as I originally uploaded the wrong template.

    As you can see this would create a row of data from the template.

    I cannot tell you how much I appreciate your help!!
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: I don't how to create a macro for my command button

    I hope I got it, I redirected the input data to Order Master starting at row 2.
    in r1 I store the next row available so don't clear it out

    Wouldn't an ingredient and spec master with pricing be useful to quantify the order?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-15-2013
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003 / 2007
    Posts
    14

    Re: I don't how to create a macro for my command button

    I keep getting this error when it runs:

    Sheets("Order Master").Cells(i, 1) = ary(i)

  6. #6
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: I don't how to create a macro for my command button

    this is the modified macro to populate the order master rows...

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-15-2013
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003 / 2007
    Posts
    14

    Re: I don't how to create a macro for my command button

    Thanks, all working perfectly!!

+ 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.6.0 RC 1