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

preview_player
Показать описание

In this Excel VBA & macros tutorial, learn how to automatically display all worksheets in an Excel ActiveX List Box and print multiple sheets as one print job. You can also use the same code to print preview multiple worksheets in one Excel print preview window.

This VBA tutorial builds on the a previous video where we displayed all worksheets in an Excel ActiveX Combo Box - selecting a sheet name from the combo box, sent the user to the respective sheet.

This time we will be using an ActiveX ListBox to allow the user to print the selected sheets in one go. We will use the Excel Worksheet Activate event to automatically populate the list of sheet names in the List Box.

We will then use the VBA For Next Loop to create a string array of the sheet names that were selected. To do this, we will use the VBA redim preserve command.

Finally we assign a command button (and later an icon) to run the macro once the user clicks it.

Aside from this, you will also learn how to debug your macros by stepping into the VBA code and using the locals window. You also learn about VBA's object library and how you can search for specific objects to learn which methods, properties and events are associated with them.

🚩Let’s connect on social:

Note: This description contains affiliate links, which means at no additional cost to you, we will receive a small commission if you make a purchase using the links. This helps support the channel and allows us to continue to make videos like this. Thank you for your support!

#ExcelVBA
Рекомендации по теме
Комментарии
Автор

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

isaacboateng
Автор

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

krn
Автор

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

razoukma
Автор

I really love your way of explanation and examples😍

nevermind
Автор

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!

EricaDyson
Автор

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 !

banarasaziz
Автор

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

akanlunadewuyi
Автор

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

ckokse
Автор

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. ✌🏾

stevemullins
Автор

Deep and clear explanation. Thank you  Leila.

enriquedominguez
Автор

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

vhjaimes
Автор

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

towfeek
Автор

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

nerenlakhraj
Автор

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

mimexicomaxico
Автор

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!

wayneedmondson
Автор

Excellent as always....Thanks Leila :)

robertovelicaz
Автор

As always, perfect, thanks to Leila ;)

persaq
Автор

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

ivamarinho
Автор

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

shironmania
Автор

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

yulinliu