Excel List Box to Display & Print Multiple Sheets as ONE Print Job with VBA

Поделиться
HTML-код
  • Опубликовано: 16 ноя 2024

Комментарии • 172

  • @LeilaGharani
    @LeilaGharani  9 месяцев назад

    Grab the file I used in the video from here 👉 pages.xelplus.com/vba-listbox-file

  • @excelaficionado
    @excelaficionado 5 лет назад

    Very Well Explained, VBA is a life saver for people like us, those who spend their life in spreadsheets....

  • @anilmudakannavar79
    @anilmudakannavar79 5 лет назад

    Once again delivered with the "Master Stroke " waiting for next one

    • @LeilaGharani
      @LeilaGharani  5 лет назад

      Wow! Thank you! I'm glad you enjoy the tutorials.

  • @towfeek1338
    @towfeek1338 5 лет назад +5

    Your efforts concerning several MS Excel videos are always appreciated.... well done...

    • @LeilaGharani
      @LeilaGharani  5 лет назад

      Thank you Towfeek! Also thank you for your support of my videos.

  • @banarasaziz4615
    @banarasaziz4615 5 лет назад

    Not Only This but all of your tutorials are awesome !
    Your way of Explaining is great and You are Best Online Instrutor for me ever.
    Wish You Good Luck !

    • @LeilaGharani
      @LeilaGharani  5 лет назад +1

      Thank you Banaras Ali Aziz! I'm very happy you find the tutorials easy to follow.

  • @mimexicomaxico
    @mimexicomaxico 3 года назад

    I love you Leila... Justo lo que buscaba... saludos desde Mi México Máxico (Mágico)

  • @ckokse
    @ckokse 5 лет назад

    Your videos are always a great source for being more efficient. Thanks for sharing.

    • @LeilaGharani
      @LeilaGharani  5 лет назад

      Thank you and you're very welcome.

  • @EricaDyson
    @EricaDyson 5 лет назад

    Oh my goodness, that's something I needed to today. I had a 'print all' to PDF button, now I can enable the user to select sheets! Thanks so much!

  • @stevemullins3338
    @stevemullins3338 5 лет назад

    Leila, I think I'm in love with you. My goodness you make Excel and VBA for that matter, so damn beautiful. In all seriousness, appreciate the sharing of knowledge, have learnt a ton. ✌🏾

    • @LeilaGharani
      @LeilaGharani  5 лет назад +1

      I'm glad to hear that the videos are helpful Steve.

  • @helmyputeraedeljaya3964
    @helmyputeraedeljaya3964 3 года назад

    Excellent .... Thanks Leila :)

  • @birbhabirbha4758
    @birbhabirbha4758 2 года назад

    Thanks you Mem for easy & ooosam tutorial 👍👍

  • @JJDSidiIfni
    @JJDSidiIfni 5 лет назад +1

    Thanks a lot Leila for this great tuto

    • @LeilaGharani
      @LeilaGharani  5 лет назад

      You're very welcome Aarab. Thank you for your support.

  • @akanlunadewuyi2588
    @akanlunadewuyi2588 5 лет назад

    Wow! what a great teacher. You are wonderful. I have just started a course which requires me all these things that you're teaching and it has been so resourceful to me. Thank you

    • @LeilaGharani
      @LeilaGharani  5 лет назад

      You're very welcome. Good luck with the course Akanlu.

  • @yulinliu850
    @yulinliu850 5 лет назад

    Great tutorial of VBA! Thanks a lot, Leila!!

    • @LeilaGharani
      @LeilaGharani  5 лет назад

      Thank you! You're very welcome Yulin :)

  • @drewbny78
    @drewbny78 5 лет назад

    Been looking for this for years!!!

  • @isaacboateng3645
    @isaacboateng3645 4 года назад

    I always enjoy your tutorials, straight forward and easy to follow. You are the one experts want to learn from. Thumps up!

  • @nevermind4780
    @nevermind4780 5 лет назад +1

    I really love your way of explanation and examples😍

  • @henrygross6608
    @henrygross6608 2 года назад

    Thank you so much for your help on this topic and the many others you have shared. I will definitely be using this code in an upcoming project. One thing that I would add is a message box to alert the user if they have not chosen a sheet and then hit the Preview button. When one runs the macro an error message pops up. I added the following and it did the trick. Thanks
    If c > 0 Then
    Sheets(SheetArray()).PrintPreview
    'If you'd like to print out
    ' Sheets(SheetArray()).PrintOut
    Else
    MsgBox "No Sheets have been selected"
    End If

  • @razoukma957
    @razoukma957 5 лет назад

    yes! i like this video, thank you sweet Leila and we always waiting for your next!

  • @vhjaimes
    @vhjaimes 5 лет назад

    Thank you very much Leila! This tutorial is really helpful for me. Great job!!

  • @wayneedmondson1065
    @wayneedmondson1065 5 лет назад +1

    Hi Leila.. thanks.. great video and useful tip and tool to add to any workbook for easier previewing and printing. I can think of many parallel uses, such as a choice to save selected sheets to PDF or save selected sheets as a separate workbook, etc. Always a pleasure to view your videos and practice learning your techniques and implementing your ideas in my own work product. Thumbs up!

    • @LeilaGharani
      @LeilaGharani  5 лет назад +2

      The PDF idea is also great! Thank you Wayne - also for your comment on the previous video which inspired me to make this one :)

    • @wayneedmondson1065
      @wayneedmondson1065 5 лет назад

      Thanks Leila.. glad to be part of the process. I built your code into a workbook with some hidden sheets and realized the need to trap for that and not load them to the list box, otherwise the PrintPreview or PrintOut routine fails, if a hidden sheet is selected for processing from the list. I added this code.. problem solved.
      For Each ws In Worksheets
      If ws.Visible = xlSheetVisible Then
      Me.ListBoxSh.AddItem ws.Name
      End If
      Next ws
      Before following your channel and taking your VBA course, I wouldn't have known where to begin, let alone being able to solve the problem for myself. Thanks for all your help and inspiration. Looking forward to your next video. Thumbs up!
      PS - Also added this code to trap for attempting to print with nothing selected in list box.. the fun never ends with VBA.. haha!!
      If c = 0 Then
      MsgBox "Nothing was selected.. try again!"
      Else
      Sheets(SheetArray()).PrintPreview
      End If

  • @sukralama1368
    @sukralama1368 Год назад

    Thanks for very useful videos...

  • @calvinc851
    @calvinc851 4 года назад

    Great programming! Thank-you.

  • @Harycan0
    @Harycan0 Год назад

    Fantastic video, unbelievable Beautiful lady, thank you very mech 💕💕💕 , really , really fantastick .

  • @justinacciavatti6656
    @justinacciavatti6656 3 года назад

    Exactly what I needed!

  • @ashrafabdallaattyaelfeky2639
    @ashrafabdallaattyaelfeky2639 5 лет назад

    Excellent as always....Thanks Leila

  • @katerina6495
    @katerina6495 5 лет назад

    Thank you Leila, great video, Viele Liebe Grüsse

  • @shironmania
    @shironmania 5 лет назад

    I need to know the vba basics to understand this tutor, this does look pretty useful too

  • @prasannaprasanna9955
    @prasannaprasanna9955 4 года назад

    Many tutorials are there but your guidance and presentation clears all doubts. Please give a detail of Redim Preserve meyhod

  • @krn14242
    @krn14242 5 лет назад

    Thanks Leila. Great video as always, you have a prefect teaching voice and explain things extremely well. Well done.

  • @enriquedominguez9709
    @enriquedominguez9709 5 лет назад

    Deep and clear explanation. Thank you Leila.

  • @devexcel2023
    @devexcel2023 3 года назад

    thank you so much Leila

  • @HusseinKorish
    @HusseinKorish 5 лет назад

    That's very usefull .... thanks Liela

  • @benedictestrada2774
    @benedictestrada2774 5 лет назад +3

    Private Sub Workbook_Open()
    Sheets(2).Select
    Sheets(1).Select
    End Sub
    works for me to refresh active listbox.
    thanks a lot and more power!!

  • @reach2sravankumar
    @reach2sravankumar 5 лет назад

    No words...God Bless u.

  • @takx1983
    @takx1983 5 лет назад

    I love this concept. I am going to implement this at work. Amazing

  • @Iron-and-strings
    @Iron-and-strings 4 года назад

    thank you, it worked great!

  • @maryjeantjrnelund9315
    @maryjeantjrnelund9315 3 года назад

    Your video saved me so much time. Thank you very much. Can you make the list skip some sheets that I don’t want in the listbox? And if so how?

  • @ajexcel
    @ajexcel 5 лет назад

    Very Classy & useful...👌👍👍😚

  • @vijaysahal4556
    @vijaysahal4556 4 года назад

    hey this is fire 👍👍👍👍👍👍

  • @crypt4519
    @crypt4519 5 лет назад

    Arrays start at 0.... love it....

  • @vida1719
    @vida1719 5 лет назад

    As always great explanation

  • @robertovelicaz7719
    @robertovelicaz7719 5 лет назад

    Excellent as always....Thanks Leila :)

  • @djdisasterjames
    @djdisasterjames 4 года назад

    Why do you not use integer for i?
    By the way I got so much value from this video, I didn't know about the Locals window, Break, icons for macros, now I know byte is 0-254 and only takes up 1 byte instead of 2 for integers, I learned to populate listboxes and the difference between selections allowed, WOW. Thank you!

  • @jee-zaldvillaflores1989
    @jee-zaldvillaflores1989 3 года назад

    hi maam Leila Gharani, nice video tutorial... and please do a tutorial on how to create a bold function in excel, on how to bold a specific text in a string formula... thanks in advance.

  • @naslucky
    @naslucky 3 года назад

    Superb

  • @esbi1124
    @esbi1124 4 года назад

    Many thanks

  • @SnookRS
    @SnookRS 5 лет назад

    Thank you Leila you are amazing!

  • @aboelmagd100
    @aboelmagd100 5 лет назад

    Thank you very much Leila!

  • @behnamebrahimi1625
    @behnamebrahimi1625 5 лет назад +1

    👍👍👌👌 Well-done

  • @Harycan0
    @Harycan0 10 месяцев назад

    You are amazing you are safe me second time . Thank you.

    • @LeilaGharani
      @LeilaGharani  10 месяцев назад

      You're welcome!

    • @Harycan0
      @Harycan0 10 месяцев назад

      ​@@LeilaGharani
      Dear Leila my be you can advise, after each opening and closing document , activexbox change size, become smoler and smoler . How to protect it ? Or lock . Thank you .

  • @sarfarajkureshi6569
    @sarfarajkureshi6569 5 лет назад

    Thanks Mam... Nice tutorial

  • @agyemangrichmond3847
    @agyemangrichmond3847 3 года назад

    Great video, can you do a video of how to print multiple data in a drop down list. Thanks a lot.

  • @linasmarocka6619
    @linasmarocka6619 3 года назад

    Very helpful video. How can I add another button which would print (or select) all sheets? Just as a shortcut if I would print them all more often. Without loosing preview function.

  • @nerenlakhraj5252
    @nerenlakhraj5252 5 лет назад

    Awesome tutorial Leila ... lesson learnt ... thank you :-)

  • @shoestringlean7163
    @shoestringlean7163 Год назад

    This is great! How would you filter that list in the list box based on certain cells on each sheet having data? (automatic instead of manual selection?)

  • @persaq
    @persaq 5 лет назад

    As always, perfect, thanks to Leila ;)

  • @TheHellis
    @TheHellis 5 лет назад +1

    Regarding your little "hack" at the end.
    You could have made the code in a module and had sheet_activate run the module sub, then in workbook_open link to the same module sub. That way you don't force the user to a different sheet, and you can open the workbook on print sheet and it will be updated

    • @LeilaGharani
      @LeilaGharani  5 лет назад

      Thank you for sharing - with VBA just like formulas you have so many ways of handling the same tasks. It's good to see the feedback from others.

  • @abdurrazzak8440
    @abdurrazzak8440 4 года назад

    Thanks sister

  • @debayanbanerjee
    @debayanbanerjee 3 года назад +2

    Hei. I am just facing one issue with this tutorial that is not matching mine. The cursor does not select the sheet inside the list box. Only when I go out of the listbox boundary and click something else outside, does the selection update. Why is that?

    • @The_Doctor1224
      @The_Doctor1224 2 года назад

      Hi Debayan, I'm currently having the same issue. Were you able to figure this out?

    • @debayanbanerjee
      @debayanbanerjee 2 года назад

      @@The_Doctor1224 It is workikg, you just have to work with better screen resolution. Are you working on multiple screens with different resolutions?

  • @excelisfun
    @excelisfun 5 лет назад

    Great video, Teammate : )

  • @prasanths7627
    @prasanths7627 2 года назад

    thank you....

  • @sarahklein5175
    @sarahklein5175 2 года назад

    Wonderful tutorial!! I am still very new to this, is there a way to have your list box to show only certain tabs? Looking to not show my first two tabs but to show the rest. Thank you!

  • @ALG_1983
    @ALG_1983 2 года назад

    Greetings to you, Miss Truth. You have a wonderful and distinctive method of explanation and in a smooth language. I have Excel sheets for printing via Listbox, but after printing there is always a problem with the rest of the codes, so how can I send you the file. Sorry for the poor expression, it's just a translation

  • @WilliamOliveiraExcel
    @WilliamOliveiraExcel 5 лет назад

    sempre com conteúdo relevante e bem interessante, aprendo muito com você.

  • @hockdrew
    @hockdrew 4 года назад

    This has been very helpful. I'm stumped on how to do this same thing, but automate print/saving to PDF. Specially using ExportAsFixedFormat. Any suggestions?

  • @kambizshokouhi6766
    @kambizshokouhi6766 5 лет назад

    Thanks a lot

  • @easanalyticssolutions1299
    @easanalyticssolutions1299 2 года назад

    Hello, Thanks for the good work. What is the VBA code that i would use if i want to print all school report forms using a single button.??

  • @prashanttiwari4428
    @prashanttiwari4428 4 года назад

    Thank you very much. What if i want to show only few sheets in the list box and not all ?

  • @ZKProgrammer
    @ZKProgrammer Год назад

    Nice

  • @aponorth
    @aponorth 5 лет назад

    Sweet! Need to get crackin on your vba course.

  • @russellfry2148
    @russellfry2148 4 года назад +1

    Hello. Instead of PrintOut, how would you go about saving as a .pdf? Thank you.

  • @anwarsha3820
    @anwarsha3820 2 года назад

    HI Leila Gharani... I really appreciate on your effort to make this video. It's teach me a lot of new thing to do in excel. Really thanks for it. HErewith I have a query that I would like to get your assitant on it... I would like to create in excel sheet the population of my neighborhood by create the command box or tex box the number of house. When ever we click the textbox or command box with the number of house, the detail of the owner of the house can be display either in print preview or in tabulation. CAn you assist me on it. I have to solve it, but unable to get it... appreciate your assitant on it. Thank you...

  • @liahu486
    @liahu486 8 месяцев назад

    Hi Leila! I want to do this, but for several specific print areas within the same sheet. I can’t figure out how to do this. I created defined names for the different print areas and put them in an activex list box, but i’m not sure how to write the VBA code for it or what to do next.

  • @ivamarinho786
    @ivamarinho786 5 лет назад

    Você é muito inteligente! Ótima dica 👍👍👍

  • @paravej
    @paravej 5 лет назад

    Too good...

  • @vhc6600
    @vhc6600 5 лет назад +1

    Hi Leila, is it possible to use a multi select enabled list box to "insert" criteria for sumproduct ? ... ie I want to use sumproduct to do a sum based on OR criteria logic and point to the listbox selection ?

  • @johnheath5546
    @johnheath5546 2 года назад

    Great tutorial Leila! How can I get a question too you?

  • @barneshudson
    @barneshudson 5 лет назад

    good idea

  • @MstJuan
    @MstJuan 5 лет назад

    Hi Leila, thanks for sharing the knowledge and helping others. I used this type of code to make a child activity record where teachers can enter the child activity per session. All is inputted from a central sheet which I would like to keep visible but not listed with in the list box is that possible please.

  • @francoislacombe1507
    @francoislacombe1507 3 года назад

    Hi Leila. I must say that you're my heroine 😁. I applied step by step the way to print many workseets at the sametime but I have an issue. Do hou have a webside where I could expose my problem?
    Thanks,
    François
    Montréal, Quebec(Canada)

    • @LeilaGharani
      @LeilaGharani  3 года назад

      It would probably be best if you would post it on Microsoft's Tech Community Platform for Excel: techcommunity.microsoft.com/t5/excel/bd-p/ExcelGeneral

  • @MsNelichuz
    @MsNelichuz 3 года назад

    Great tutorial!
    I did it and it worked while testing. However now it does not work properly for a "random"selection. Keeps saying "error 1004". Any ideas of what I'm doing wrong?

  • @aayushk.c.2081
    @aayushk.c.2081 2 года назад

    Hi Leila, I have been following your channel for a while now and I would really appreciate if you could help me with printing in landscape as well as portrait within the same worksheet. I could print one-one page but it would take a lot of time especially if I have to print the same document again and again. So how will you approach this problem? I would love to hear your thoughts. Thanks.

  • @md.tanwir9108
    @md.tanwir9108 4 года назад

    This Tutorial was Impressive and I am in Learning stage. I wonder Is it possible to print in single page, different sections of same sheet. for example: In sheet1 I want to print cells A1: B5 and C10:F20 . Just in my mind. Thank you.

    • @piski12
      @piski12 2 года назад

      did you find a way how to do this? maybe some help @leila gharani

  • @muhammadabdulrasool206
    @muhammadabdulrasool206 5 лет назад

    Thanks a lot for your amazing way in explanation these topics.
    I have a list with some items that are dynamically connected to the sheet it’s located on and want to print that sheet for each item in the list, is it possible to do that using macro?

  • @hosseinhosseinpoor4845
    @hosseinhosseinpoor4845 3 года назад

    thanks...

  • @MellifluentBlue
    @MellifluentBlue 5 лет назад

    Leila your videos are excellent and the way you softly and slowly speak is absolutely amazing for viwers around the Globe.
    I have an excel with data of more than 100 teacher.. Now I want to print separate page for each teacher and hand it over to them.. One way is to filter teacher and print which would take to filter 100 times.. Is there a way or trick i command to print teacher wise data with few click

  • @MasGesHusni
    @MasGesHusni 9 месяцев назад

    dear LeilaGharani, is it possible to do that in listbox userform? cause the video is in listbox worksheet

  • @ExcelMadeEasy444
    @ExcelMadeEasy444 5 лет назад

    Perfect Explained !! Can we print multiple sheets on a single page by vba coding ?

    • @LeilaGharani
      @LeilaGharani  5 лет назад

      Thanks Ashok - Do you mean printing different ranges from the sheets? If yes, you can specify the print range for each sheet...

    • @ExcelMadeEasy444
      @ExcelMadeEasy444 5 лет назад

      @@LeilaGharani want to print sheets("Sheet1").Range("A1:C50"), sheets("Sheet2").Range("A1:C50") fit on onesided A4 paper.

    • @piski12
      @piski12 5 лет назад

      @@LeilaGharani is there any way you can help me out how to do this? I am trying this for already over 2 weeks and cant find a way :/
      So I want to select multiple sheets and also print range in those selected sheets..thank you in advance!

  • @zozozozo43
    @zozozozo43 5 лет назад

    Thank you 🌼🌼⚘

  • @williamsatish25
    @williamsatish25 5 лет назад

    Ok I'll check

  • @kehindeateniola3801
    @kehindeateniola3801 5 лет назад

    Please, how do you extract down into consecutive rows using a list box multiple selection with checkboxes and vice versa.

  • @OmarAhmad-ql8sz
    @OmarAhmad-ql8sz Год назад

    Hi
    Instead of list box can I use sheet 2 and cell B2 to B10
    to print the sheets with that names without selsctin them

  • @WaveCasualGaming
    @WaveCasualGaming 4 года назад +1

    How do I list only the visable sheet? I don't want my hidden sheet show up in the list.

  • @FrancisDCosta
    @FrancisDCosta 5 лет назад

    Leila, I would like to embed an insurance rates calculator on my website so customers can can check their insurance quotes. How can I do that or can I use your services in the respect? Thanks.

  • @sat1460
    @sat1460 5 лет назад

    Thank you very much for this trick and one more thing mam how to view vba code if Excel is locked by unviewable project shared workbook ...how to crack it ...looking for your reply

  • @robertasz9458
    @robertasz9458 5 лет назад

    Thank you Leila for this video.
    I wonder, would it be possible to create the same list but filled not with sheet names but with print area names?

    • @LeilaGharani
      @LeilaGharani  5 лет назад +1

      You're very welcome. You could define the sheets & print areas in a separate sheet and use these for the list box...

    • @piski12
      @piski12 5 лет назад

      @@LeilaGharani wow thats just what I am looking for. Would be awesome to know how to do this. Any chance you make a tutorial about it? :) :)

  • @miryam463
    @miryam463 4 года назад

    Regarding printing: I got a table that fits in a single page when printed. The table has titles in the top row. When choosing a value from the top left filter in the top row of the table, the dependent array below the filter gets filtered accordingly, and so the whole table now has less rows than when it's unfiltered.
    What's the VBA code to automatically select the first value from the filter, and automatically print on paper the filtered table; then select the second value from the filter, and automatically print on paper the filtered table; and so forth until you have finished printing on paper all available values from the filter? Thanks in advance.

  • @Jordannahuwo622
    @Jordannahuwo622 6 месяцев назад

    Is it possible to print all (from drop down list) to a single pdf file ?

  • @shotsbyfizza
    @shotsbyfizza 2 года назад

    What if we only want the last some sheets to be visible in the listbox to avoid clutter and unnecessary sheet names?