+ Reply to Thread
Results 1 to 12 of 12

Macro to create multiple menu sheet

  1. #1
    Registered User
    Join Date
    06-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    85

    Macro to create multiple menu sheet

    Hi

    I'm trying to automate my food menu creation process. I'm trying to create a macro which will create a menu for each day based on the data in "Menu Data"

    I've incluced an example of the format in the "Monday" tab, but I'm having trouble replicating this when writing the macro.

    Any help will be hugely appreciated.
    Attached Files Attached Files
    Last edited by Harry Basra; 02-19-2020 at 09:18 AM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,978

    Re: Macro to create multiple menu sheet

    Click the button....
    Attached Files Attached Files
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    06-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    85

    Re: Macro to create multiple menu sheet

    Berine!, thank you very much for this!! This is great!

  4. #4
    Registered User
    Join Date
    06-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    85

    Re: Macro to create multiple menu sheet

    Hi Bernie,

    Please do you mind telling me how the macro is pulling the info based on your code, just in case i need to add any more data/food courses to the menu?


    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,978

    Re: Macro to create multiple menu sheet

    The macro assumes that your data is in groups of two: soup, then entree, and just uses math to step through the data. If you were to add, say appetizers and desserts (groups of four) then you would need to change the 2s to 4: if you added extra soups and entrees, then you would need to change the 2s to whatever the total number of items each day has.

    But, and this is an important but, you would need to move the first data point to the nth row (it just worked out nicely that you have two items, and the first item is on the 2nd row). So if you have 10 items, the first item should be on the tenth row so that the indexing works out OK. ((You could also subtract an offset, but I like the simplicity of starting the data in the correct place.)

    Here is an example with two soups and two specials (note that I had to fix a slight error in formatting/logic with a new version at noon EST US)
    Attached Files Attached Files
    Last edited by Bernie Deitrick; 02-19-2020 at 01:06 PM.

  6. #6
    Registered User
    Join Date
    06-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    85

    Re: Macro to create multiple menu sheet

    Hi Bernie,

    Sorry to trouble you again, I've spend the last day trying to get this work and just cant figure it out. I've now included the all the menu items and added all the courses.

    I tried to apply your logic, but there was always something missing when i ran the macro.

    Please do you mind having a look for the last time?
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,978

    Re: Macro to create multiple menu sheet

    I took some liberties with adding prices.....
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    85

    Re: Macro to create multiple menu sheet

    you're great! thank you Bernie!

  9. #9
    Registered User
    Join Date
    06-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    85

    Re: Macro to create multiple menu sheet

    Hi Bernie,

    I hope you're well? I have one last questions with the sheet you worked on, please? I need to spit the soup course out as you have with the vegetable selection. So 2 lines for soup courses.

    Is this something you could help with, please? I used your theory and moved it all down to the 9th line, but still noluck.

    Many thanks,
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    06-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    85

    Re: Macro to create multiple menu sheet

    Hi Bernie,

    I hope you're well? I have one last questions with the sheet you worked on, please? I need to spit the soup course out as you have with the vegetable selection. So 2 lines for soup courses.

    Is this something you could help with, please? I used your theory and moved it all down to the 9th line, but still noluck.

    Many thanks,

  11. #11
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,978

    Re: Macro to create multiple menu sheet

    I have changed the code to allow you more flexibility without having to worry about placement or the code. As long as you have the same keywords in B as on your template, with enough rows (2 + the number of that type) then the code should continue to work without my stepping back in. Just make sure that you have the same cell merging that you currently use.
    Attached Files Attached Files
    Last edited by Bernie Deitrick; 03-26-2020 at 10:51 AM.

  12. #12
    Registered User
    Join Date
    06-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    85

    Re: Macro to create multiple menu sheet

    thank you very much

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 02-05-2019, 12:03 AM
  2. Replies: 11
    Last Post: 12-19-2016, 10:37 AM
  3. [SOLVED] Not creating "cycle" of PDFs of named range based on cell values in second sheet
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-27-2016, 02:12 AM
  4. [SOLVED] Code that copies row of data to another sheet based on text "Complete"/"Delete"
    By Dremzy in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-20-2014, 05:51 PM
  5. Replies: 2
    Last Post: 04-20-2014, 11:18 AM
  6. [SOLVED] Need Macro to compile data from "Weekly" sheets and sum up into "Monthly" summary sheet
    By mo4391 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-21-2013, 07:25 PM

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