Excel VBA Progress Bar on Userform

Sdílet
Vložit
  • čas přidán 8. 09. 2024

Komentáře • 95

  • @sanssatori
    @sanssatori Před 5 lety +1

    Something happened which has never happened watching anybody else's tutorials. It worked the first time!!!! Thank for your clear and concise video, this was really nice.

  • @wickedlikethreesixes5167
    @wickedlikethreesixes5167 Před 4 lety +1

    This really helped me out a lot, thank you. Before this video I found code online for implementing progress bars and it was well beyond my programming capabilities.

  • @PHobbs
    @PHobbs Před 5 lety +1

    I tend to overthink things, and was thinking a project like this would be more difficult. Thank you for the tutorial, and showing me how easy this script is.

  • @philipmcdonnell7168
    @philipmcdonnell7168 Před 3 lety

    Thanks Alan. This was one of the first videos of your that I watched and until today have never made it work (my brain being somewhat addled). Today, however, I got it to work: I had to slot the contents of the Do While into a For Next loop that loads records into a worksheet from a db and formats them for UX reasons. Now I just have to get tricky with it. ;)

  • @minhafathima9535
    @minhafathima9535 Před 3 lety

    Great Sir, you are my super hero

  • @noeliamontero3839
    @noeliamontero3839 Před 2 lety

    Great explanation for VBA beginners, thanks so much!

  • @georgeloizides7555
    @georgeloizides7555 Před 2 lety

    Very Illustrative Example . Thank you very much sir!

  • @dennismorley1647
    @dennismorley1647 Před 4 lety

    Great explanation and demonstration and easy to follow. Have been meaning to install this feature but have always thought it too difficult, and then within minutes I had it running in my macro - I'm so chuffed now. Many thanks - so grateful for your contribution.

  • @mohammadarif4153
    @mohammadarif4153 Před 3 lety

    Excellent...very helpful....

  • @abrieventer157
    @abrieventer157 Před 4 lety

    Thanx for this easy to understand video. Method is easier than others I have seen. Thanx again.

  • @kennytait8431
    @kennytait8431 Před 6 lety +1

    Thanks a lot, this is a great bit of code and your video is really easy to follow. I had a userform connected to a macro that just displayed the comment "Calculating ....... Please Wait", but this is so much better. I simply added a bar as you described into my existing userform. My only problem was that I have no loop in my macro. Solved that by simply adding the update lines with a new width / percentage number at various stages of my code.

  • @JanBolhuis
    @JanBolhuis Před 2 lety

    Great video and well explained. Thank you.

  • @KleanthisSkoulikaris
    @KleanthisSkoulikaris Před 3 lety

    WOW! Just....WOW!!!

  • @prayan72
    @prayan72 Před rokem

    Thank you! Great video. Is there a way to put the button "cancel" in the form so that if it takes too long the user can abort the procedure?

  • @LuckVagner
    @LuckVagner Před 4 lety

    Very easy to understand, great job!!!

  • @kennethschuman167
    @kennethschuman167 Před rokem

    Great video! I worked along with several progress bar video’s but with yours was simple AND mainly I got it to work, SO MANY THANKS. One question; after the progress bar macro ends there is a 5 second delay as my full macro updates and ends. Can this 5 sec. delay be incorporated in the progress bar display?

  • @anthonyfisiihoi
    @anthonyfisiihoi Před 4 lety

    Great tutorial and explanation. Clear and precise! *thumbs up*

  • @javierlira6033
    @javierlira6033 Před 5 lety

    wonderfull... i made a similar subroutine but I used the statusbar... but it was a desperate solution with the clock ticking... thanks for the video, i will improve my program with it

  • @evandawson1037
    @evandawson1037 Před 4 lety

    This is just fabulous! Just exactly what i expected to do for my project!

  • @user-rb4uk5wz6r
    @user-rb4uk5wz6r Před 6 lety +1

    Thanks a lot! So easy!

  • @HerculesSantosLoyola
    @HerculesSantosLoyola Před 5 lety +1

    Parabéns pela aula, eu achei incrível.

    • @Computergaga
      @Computergaga  Před 5 lety +1

      Thank you.

    • @HerculesSantosLoyola
      @HerculesSantosLoyola Před 5 lety

      @@Computergaga embora eu não fale Inglês, consegui perfeitamente entender a sua aula e executar com sucesso a barra de progresso. Parabéns pelo seu ótimo trabalho, sou muito grato!

  • @johnadam7996
    @johnadam7996 Před 4 lety

    thank you for this amazing tutorial

  • @aymen.zaggar
    @aymen.zaggar Před 4 lety

    We can also divide progressbar.width by progressframe.width to get the percent without adding another variable

  • @hungskya820l7
    @hungskya820l7 Před 4 lety

    Very Good. Thanks

  • @sisoader7391
    @sisoader7391 Před 2 lety

    GOOD JOB.THANK YOU. HOW CAN I USE THIS PROGRESSBAR IN ACCESS TO IMPORT EXCEL FILES. THANKS

    • @Computergaga
      @Computergaga  Před 2 lety

      Thank you. It all works from the loop. So, whatever macro you are creating, set the loop to track the progress how you need it. I can' provide all the code here.

  • @simxschl
    @simxschl Před 3 lety

    This progress bar works well but the macro seems to take MINUTES longer (700 sec instead of 8 sec normally) if I use "Application.ScreenUpdating = False". If I don't use "Application.ScreenUpdating = False" then it's about 18 sec which is kinda okay but I don't like that flickering of the macro when it switches between worksheets

  • @user-yy6vn7ig2d
    @user-yy6vn7ig2d Před 4 lety

    Can it be done on a range as well?
    To copy range cells from sheet to another.
    For example A2:C60

  • @aposieczanek
    @aposieczanek Před 3 lety

    What do you do if the % of 100% complete is unknown? or undefined? Are you still able to use a progress bar?

  • @canmanttv3306
    @canmanttv3306 Před 3 lety

    Great video! Just one problem, I did basically the exact same thing you did in the video, but trying to make the form in the personal workbook, as well as the module is in the personal workbook. I am wondering if this is even possible. When I call "Progress", it says "file not found" and then error 361. I have no idea if this is even possible, but please help!

    • @canmanttv3306
      @canmanttv3306 Před 3 lety

      Nevermind, I got it figured out the next day thank you so much

  • @Elchimbotanito69
    @Elchimbotanito69 Před 4 lety

    Thank you! Lo pude utilizar en mi aplicativo. Saludos de Perú

  • @Sysco360
    @Sysco360 Před 6 lety +1

    It's wizardly when you make genius look like child's play. I am a rank noob but would like to add the progress bar to display while a SQL Query refreshes after clicking a button assigned to Macro calling Refresh.

    • @Computergaga
      @Computergaga  Před 6 lety

      Thanks Adam.

    • @Sysco360
      @Sysco360 Před 6 lety

      Most welcome! :) but guess I should have been more clear... I was hoping for some help with that... if it's not too big a deal?

    • @Computergaga
      @Computergaga  Před 6 lety

      To update the progress bar we would need a stage to frequently update it. If the SQL refresh is one statement, I'm not sure how we can do this.
      For example, in the video we can check the update through the loop and have a rough estimate of progress. Unless we could query how far through the refresh the SQL query is, we cannot estimate this.

    • @Sysco360
      @Sysco360 Před 6 lety

      Thanks for the reply Alan. I actually understand what you are saying, which is something. What if I knew that the query takes on average say 4min 35sec and really does not deviate from that amount of time. Would it be possible to tie the progress bar to that, but also have it terminate early if the SQL query finishes before that estimated time?
      p.s. Like to buy you a coffee card for your help or 'donate' somehow. your videos are priceless sir! Do you have Starbucks or a donation account?

    • @Computergaga
      @Computergaga  Před 6 lety +1

      Hi Adam, not something I have done so am unsure how to update based on time.
      I do not have a donation card. Thank you for your kind offer.

  • @johnleo6419
    @johnleo6419 Před 3 lety

    I have a question: I’d like to keep a bunch of stuff in my userform (100s of frames, labels and other objects) which are overlapping on each other. So It’s becoming very difficult to work on those, is there a way we can hide/unhide the frames on the userfom ?? Because every frame I use covers the entire userform, and there are many objects inside each frame.
    So I wanted hide all other frames except the one I’m working on, and again I’ll hide this and unhide another frame which I’ll work on and so on…
    I’m not asking to hide/unhide these frames after running the VBA, I know how to do that. I want to know if it’s possible to hide while we are coding

  • @tonnievaneldik9183
    @tonnievaneldik9183 Před 3 lety

    How can i use this ProgressBar in my files so it appear when i run a macro.
    I don't understand how it can be work on my files.

  • @mithunjan18
    @mithunjan18 Před 4 lety

    How should a make this pgress bar working if i dont have any Do while or Each cell loop in my macro.... i have 19 modules in my macro and all 18 are called from module 1. Is it possible to run this progress bar whenever each module completed..... ?

    • @Computergaga
      @Computergaga  Před 4 lety +1

      For sure. You just need to increment the bar a little after each module. I used a loop, it could be anything. 100/18 and increment by that percentage each time as a rough guide to progress.

  • @BrewMAJret
    @BrewMAJret Před 7 lety

    This is great. You have a single line of code encapsulated by the Progress Bar script. I like to put things into my Personal.xlsb like your progress bar. I have several instances where the progress bar would be cool, but it would not be practical to encapsulate each of my macros with it. Is there a way to call the progress bar script from my existing macros?

    • @Computergaga
      @Computergaga  Před 7 lety

      Absolutely. The progress bar script can be stored in your Personal.xlsb and run using Application.Run(Personal.xlsb!ProgressBar")
      This could open your userform. Depending on the macro and what it does, you may have to tweak how it calculates the macro progress though.

    • @BrewMAJret
      @BrewMAJret Před 7 lety +1

      Thanks for your quick reply. BTW, I follow you on Twitter and your Tweet caught my attention, and your excellent video intrigued me. I looked at several other Progress Bar videos and yours was by far the best one.
      To further explain my question, your solution encapsulates your actual macro (increase each value in column J by 10%) with the progress bar. If I were to call a progress bar macro via the application.run(personal.xlsb!ProgressBar) macro, then how would I insert my actual macro (instead of increasing values in column J by 10%) back into the ProgressBar macro? Macro A calls ProgressBar macro, but ProgressBar needs to track the progress of macro A or B or ...
      I don't really have a project for this. I was just trying to take your method to the next step and make it portable either by making it an addon, function or macro in my personal.xlsb. Sorry if all this is outside the scope of a CZcams comment :)

    • @Computergaga
      @Computergaga  Před 7 lety

      Thank you very much for your comments. Much appreciated.
      Yes to generalise the macro by putting it into a Personal.xlsb file is difficult because the method of calculating macro progress would differ depending on what the macro does.
      You may be able to have the Progress form in Personal.xlsb and the sub with the userform initialisation and the variables for bar.width and text.caption. But the progress calculation would probably have to happen in the sub of the active workbook.

    • @richardgreves6161
      @richardgreves6161 Před 5 lety

      @@Computergaga I tried this, and while the sub is called properly (the form is initialized and shows up on the screen, the BarWidth variable crashes (BarWidth = Progress.Border.Width * CurrentProgress). It says object required

  • @hokh5003
    @hokh5003 Před 4 lety

    Hi, how about progress bar when we loop through the file in the folder?

    • @Computergaga
      @Computergaga  Před 4 lety

      Yes, you can do this with the same technique demonstrated in the video. Maybe count the number of files in the folder and then use that as your percent to work through.

  • @SandeepKumar-sb3pq
    @SandeepKumar-sb3pq Před 6 lety

    Awesome video, thanks, but I do have one question , I have got almost 20 different columns which has 20 different loops running , so for each loop I have to introduce the call function ? So if one loop finishes (I.e code gets executed for one column) then won’t the progress bar be 100% and be misleading ? Thanks

    • @Computergaga
      @Computergaga  Před 6 lety

      You can update the progress bar whenever you want Sandeep so that it is as accurate as you want it to be. So you could update it after each call function. So it updates 5% after each call for example. It is just a guide to progress.

    • @SandeepKumar-sb3pq
      @SandeepKumar-sb3pq Před 6 lety

      Thank you Sir for your reply, i finally figured it out with your help :)

    • @PHobbs
      @PHobbs Před 5 lety

      Sandeep, I would imagine you could calculate the percentage of total cells looped through rather than the total rows that Computergaga does in this video. So if each column has 1000 rows of data to be looped through, and you're looping through 5 columns, you would just calculate the percentage of 5000 cells total that you're looping through.

    • @sanssatori
      @sanssatori Před 5 lety

      ​@@Computergaga This is EXACTLY what I need. Can you give me some more guidance or direction on how to do this?

    • @RAragao
      @RAragao Před 5 lety

      @@SandeepKumar-sb3pq would you be kind to let us now how did you use this code for more than 1 loop through several columns?

  • @sudiptaghosh326
    @sudiptaghosh326 Před 6 lety

    Sir first of all thank u so much for your valuable training. Sir I made a Inventory Software based on excel which has 6 sheets... those are ITEM LIST MASTER COPY, INVOICE GENERATOR, RECEIVED LIST, ISSUED LIST, CURRENT STOCK AND SALES REPORT.... all are inter connected. In invoice template I can bill 20 items at a time. This template has few macro buttons like stock update, save as pdf, sales report, new invoice etc... When I run Stock update button, My "Issued List" sheet updates with sales item and also items deducts from Current Stock Sheet which shows balance stock. Sir my problem is When I am entering items in Invoice template for billing its very hard to track each items balance stock... My question is sir Is there any options to make such a display which will show the current stock of that particular item which ĺ enter in invoice template for billing???

    • @Computergaga
      @Computergaga  Před 6 lety

      Absolutely. As you enter the item number we can run a search and return the stock level into a cell.

  • @satyenpurohit3947
    @satyenpurohit3947 Před 7 lety

    Can we increase speed of progress bar, if yes, then how

    • @Computergaga
      @Computergaga  Před 7 lety

      The speed of the progress bar is determined by the macro and how long it takes. We could speed it up by making it update less often. So in my video example, get it to update every other row.

  • @vivekkashyap7732
    @vivekkashyap7732 Před 5 lety

    Great.. My code is without loops.. I call many subs in my code.. How can I use this without loop.. please help

    • @Computergaga
      @Computergaga  Před 5 lety

      You could maybe use the sub calls as progress. It depends on the macro and how you would like to show updates. Loops are an obvious choice. But if you have say 4 sub calls. you could update the progress bar by 25% each time.

  • @priya.8170
    @priya.8170 Před 4 lety

    Its not Working kindly help me

    • @Computergaga
      @Computergaga  Před 4 lety

      I can't help without seeing what might be wrong. Please check through the video again to look for any mistakes.

  • @raysomnaths
    @raysomnaths Před 2 lety

    SSS [Simple Smart Solution]

  • @kanavkohli794
    @kanavkohli794 Před 5 lety

    Too confusing, you need to explain it clearer