+ Reply to Thread
Results 1 to 21 of 21

customized ribbon to run the macros created for a Summary Sheet

  1. #1
    Registered User
    Join Date
    01-29-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 365
    Posts
    40

    customized ribbon to run the macros created for a Summary Sheet

    Hi all,

    I have had loads of help from Weebellah to process and delimit a csv order sheet which creates a workbook with a tab for each order.
    I now want to create a summary of all the orders with a total of each type of wine for a stock check. I have created 5 macros: one call the macros; one to create a Summary Sheet; one to collate the orders from every other worksheet; one to then total the different types of wine and then delete the duplicates except one with the new total and finally a macro to put in some heading lines to tidy up the Summary Sheet.

    I then created a custom ribbon with the two groups - one which only has a link to the macro to call all the macros and another to open a worksheet and do some sorting or emailing.

    However, I have tried to save as an Add-in, export the customUI and nothing works if I try to send in a zip file to another computer. I have to then copy the macros and create the ribbon all over again with the link to the call all macro.

    I have attached a copy of the workbook with just two orders and the vba script for the macros if anyone can help me - NOTE: please forgive my vba - most I could only do via recording a macro but it does work!

    Thank you so much everyone
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: customized ribbon to run the macros created for a Summary Sheet

    How are you creating the ribbon? If your just doing it from the Excel GUI thats not gonna cut it.

    You can either use VBA to create the ribbon or XML.

    I prefer XML and use this tool in this link:

    https://www.rondebruin.nl/win/s2/win001.htm

    The basic process I use to create my addins (xlam) is to start with a xlsm file, write my code, use the UI editor to create my ribbon and then save as xlam. The addin is then self contained with all the code required to run the macros and the ribbon to load for it.
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

  3. #3
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: customized ribbon to run the macros created for a Summary Sheet

    Hi Angelique,
    If you want the ribbon to be available at all times you must embed it in the xlam file I created for you in your previous thread.
    I will see what's wrong with the new ordes not going well in there is a difference and also check the Custom UI you mention
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: customized ribbon to run the macros created for a Summary Sheet

    Where did you 'place' the ribbon you created? it's not in the attached Excel file

  5. #5
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: customized ribbon to run the macros created for a Summary Sheet

    Quote Originally Posted by Zer0Cool View Post
    How are you creating the ribbon? If your just doing it from the Excel GUI thats not gonna cut it.
    The basic process I use to create my addins (xlam) is to start with a xlsm file, write my code, use the UI editor to create my ribbon and then save as xlam. The addin is then self contained with all the code required to run the macros and the ribbon to load for it.
    Exact same process I did and use. I have an Addin file that contains all of the RibbonX code done with CustomUI Editor with callbacks to the actual VBA code in the modules contained in the Addin file. And when you get better at it, you can learn how to also add custom images and other 'cool' things to it.

    then you just share the Addin File with others as needed.

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: customized ribbon to run the macros created for a Summary Sheet

    Can you attach the file that gives the runtime error when the orders have different quantities?

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: customized ribbon to run the macros created for a Summary Sheet

    Okay, I think I got it.
    I placed the macro in the xlam file and made sure that the order file was opened and ran the macro.
    You want to place that macro so that it's tun after all the orders have been read?
    This is the summary sheet (result)

    I'll add the button and pass you the updated xlam file
    Attached Images Attached Images

  8. #8
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: customized ribbon to run the macros created for a Summary Sheet

    Here's the xlam with the stock macro active in the ribbon.
    It will only work if a processed winde order file is open and active
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-29-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 365
    Posts
    40

    Re: customized ribbon to run the macros created for a Summary Sheet

    Dear Weebellah,

    Thank you so much - I am going to see how to embed into the xlam file as you said. Please now find attached the worksheet with Jane Smith having one more order than John Doe. This is when I get a runtime error1004

    When you Debug it is in the Public Sub ProcessOrders()- the section for iRow = 3 - highlighting the part "Selection.TextToColumns Destination all the way down to TrailingMinusNumbers:=True"

    Angelique
    Attached Files Attached Files

  10. #10
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: customized ribbon to run the macros created for a Summary Sheet

    I use the CustomUI Editor (downloadable from Microsoft site) and the macro that handles this is the one in the Orderprocessing module
    I'll see if I can id the reason for the error

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: customized ribbon to run the macros created for a Summary Sheet

    Found the reason for the error.
    Modified the vba code and it will now adjust to any amount of orders per customer.
    Have included the processed report as well as the orders report you attached previously

    And, BTW is Keebellah not weebellah
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    01-29-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 365
    Posts
    40

    Re: customized ribbon to run the macros created for a Summary Sheet

    Dear Keebellah,

    Sorry about that - typo error - you should see how people try to spell Angelique though lol.

    That is amazing - I am having great fun with Custom UI Editor for Microsoft Office

    By the way, just one last thing. Ages ago Keebellah you said that if I enable a part of your script I could get the folder
    option to work for the target for each customer to go into individual folders. I am not one hundred percent sure where though.
    Would you mind pointing me in the right direction please?

    I just want to say I am so grateful for all the time and effort you have put into helping me. It has helped a lot
    so that I can practice and learn which is wonderful.

    Angelique

  13. #13
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: customized ribbon to run the macros created for a Summary Sheet

    You see why I enjoy playing with VBA

    You can choose to place each customer in a separate file

    The code for each customer in a seperate folder requires that you add code to create a folder on the fly for each customer and place their file into that folder.
    Attached Images Attached Images

  14. #14
    Registered User
    Join Date
    01-29-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 365
    Posts
    40

    Re: customized ribbon to run the macros created for a Summary Sheet

    Dear Keebellah,

    Yes I tried that, I selected the tick box - the button underneath then changes appropriately but when it
    processes it comes out as one workbook still with the customers on tabs.

    So I thought there was something to do with 'wbNew.SaveAs FileName:=targetFold if Not allInOne' in the orderProcessingModule to enable the script to utilize this.

    Angelique

  15. #15
    Registered User
    Join Date
    01-29-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 365
    Posts
    40

    Re: customized ribbon to run the macros created for a Summary Sheet

    or actually is it the Private Sub CheckBox1_Change() ? in the WineOrderprocessingForm coding for that tick box?

  16. #16
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: customized ribbon to run the macros created for a Summary Sheet

    I see, strange, it worked before.
    Will check it and get back to you when i found out the reason.
    Sorry for that.

  17. #17
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: customized ribbon to run the macros created for a Summary Sheet

    Found the culprit
    Variables were reset when the userform was unloaded.
    It only doesn't show a confirmation when you select separate files per customer
    Will work on that and attach it later
    Attached Files Attached Files

  18. #18
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: customized ribbon to run the macros created for a Summary Sheet

    Added an extra button to select and open a processed wine order file.
    Attached Files Attached Files

  19. #19
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: customized ribbon to run the macros created for a Summary Sheet

    Your favourite stalker, minor improvements like checking if the opened file is correct for the selected task.
    Like if you want to process a new order but select an already processed file it will tell you so and stop.
    If you want to create the summary and you have not selected a correct processed wineorder file it will stop.
    A button to close and opened file
    The unload button will now also check if there are other files open, if not it closes Excel or else just unloads
    And its version 2 now
    And of course you can do much, much more with vba.
    Happy coding
    Attached Files Attached Files

  20. #20
    Registered User
    Join Date
    01-29-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 365
    Posts
    40

    Cool Re: customized ribbon to run the macros created for a Summary Sheet

    Well .... what can I say. I am really happy - it works like a dream. This is just amazing, thank you so much Keebellah. I am going
    to spend a lot of time looking through and trying this out.

    Again, thank you very much Keebellah. You are my hero

    Kindest regards

    Angelique

  21. #21
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: customized ribbon to run the macros created for a Summary Sheet

    If you want to get tips and ideas look up Ron de Bruin's site (just type in Ron de Bruin and Excel in Google).
    He's got a lot of tips and sample files also a lot about the ribbon.
    I started there and time and imagination did the rest
    Happy coding

+ 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. Customized Buttons in Ribbon Bar
    By BrianAll in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2018, 04:24 AM
  2. Assign VBA code to customized ribbon
    By stberger in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2018, 08:19 PM
  3. customized ribbon
    By aprildu in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2016, 12:26 PM
  4. Excel Customized Ribbon
    By confusebox in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2016, 02:14 AM
  5. Importing customized toolbar with macros into Excel 2010 ribbon
    By RBoffice in forum Excel Programming / VBA / Macros
    Replies: 35
    Last Post: 01-25-2015, 11:12 PM
  6. Export a customized ribbon automatically???
    By ahigh17 in forum Excel General
    Replies: 3
    Last Post: 08-24-2013, 05:33 AM
  7. Replies: 6
    Last Post: 04-15-2013, 07:28 AM

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