Macros & VBA Training Series Part 3:

How to Create a Userform to Export Worksheets

Double-click video to view in Full Screen HD.

Download the file used in this video:

The Exports Sheets Userform.xlsm (216.4 KB)

Bonus: How to Export The Selected Items Only

In this video I explain how to set the listbox multiselect property to allow the user to select multiple items. We then add code to the Export button’s Click event to only export the selected sheets. We do this with an IF statement.

Macros & VBA Training Series

Video 1

Intro to VBA:
Writing Your First Macro

Video 2

Automating Tasks:
The Summary Report

Video 3

The Exports Sheets App

How features can we add to the userform?

Please leave a comment below with your answer, and any questions.  Thanks!​

Click Here to Leave a Comment Below 133 comments
Emir - December 1, 2018

Hi, 1st thanks for nice video we learn too much from it
so have a question please.

need to copy this more than 2 or 3 times for same user from different file so how do it?

Anterea - August 19, 2018

Thank you so muj Jon,

The 3 videos are really helpful to me as a beginner.

Look forward to see more of your courses.

have a great day!

Gabe - July 31, 2018

Hey! Thanks for these 3 videos, i’m not sure if this is the right place to ask this question, i’m certainly interested in the pro course, but there are some things that i don’t get and stop me from buying it… the thing is, where i’m from 300 bucks is a ton of money, actually 30% of my monthly income, and i know knowledge is always a good investment,… i should stop rambling
How does the 30 day return policy work? i mean if the course is delivered entirely to the student as the payment finished its process (so that the student can own-pase the course), how can you be certain that no one can watch all videos in a week and ask for a return?? i assume the contents are kind of time locked? I’m not planning on asking for a return in any way, specially after watching plenty of videos from you in youtoube, i believe i can use all the info in the pro course and that’s enough for it to be worth, however from a business stand point i don’t get how you can offer the return policy as a guarantee… is it that you just trust that the student won’t do what i just said (watch all the content super fast and return it)? or do you have a way to defend against it like the one i said (time locked content)?
This matter is primarily what is stopping me from spending 30% of my montly income u.u, i hope you can clarify it for me.-

Thank you!

PS: in the case i’m convinced to spend the money, do you accept paypal?

Walter - July 23, 2018

The three videos were fantastic, helpful and easy to understand.

Zia Siddique - July 18, 2018

Hi Jon
3 Awesome videos. I really enjoyed them. At first glance VBA seems quite complicated but you have shown with a bit of work you can start to understand VBA’s possibilities.

One suggestion I would add is is there a way to format the dialog box. Everything looks very grey – how would you change the colour of the form. Small things but they all add to the feel of the work that is being shown to the user.

I am enjoying all your videos. Hope to hear from you soon.


    Jon Acampora - July 24, 2018

    Hi Zia,

    Thank you for the nice feedback. Great suggestion! Yes, the userform background and controls can be formatted with different colors. We can make them look a bit more modern with some formatting techniques. I’ll add a video about this in the future.

    Thanks again and have a nice day! 🙂

Augusto Donoso - July 11, 2018

HI Jon! Tks for the very well explained video. I am a Mac user so I wanna ask you a question.

1. How can I open a file directly from the user form using your example.


Karl - July 8, 2018


Well done. Thanks.

I would like to create a tool that enables (anyone who uses it) to create a Manifest file that would be used to upload a course to a Learning Management System (LMS). The file would be XML, thus would have to be able to use a combination of variables, formulas, loops, and special characters.

Imagine a document that the Course Designer would have filled out items such as:
* Course Title
* Course Description
* Course Chapters
* Course Lessons Title
* Course Lesson Filenames
* Course Objectives

Then once it’s all filled out, the automation creates the manifest file based upon the collected information above. Part of the file would look like:

—— sample excerpt ——-

[Lesson Title]

—— sample excerpt ——-

Then when it’s all finished, it saves the file as a text-based file with the .XML extension.

* No two courses would look alike.
* Some courses may only have 1 chapter and (let’s say) 3 lessons. Whereas other courses may have 5 chapters and 25 lessons.

I’ve got a lot to think about, but I’d be curious if you had any thoughts about this idea.

D Van Camp - June 28, 2018

In this 3rd video, twice the ‘hint’ came up (once for .SaveAs and once for .Close) there was an enclosing set of parentheses around the parameters but you did not include them. I would have automatically typed “(” to begin the parameters. Why didn’t you need them? (I’m OCD 😉

BTW, I have gotten quite a lot out of these three videos! Keep up the good work!

Rafid - June 5, 2018

Thank you so much for your fantastic training

Alain de Coriolis - June 3, 2018

Hi John,

Thank you for the easy to follow Intro to Excel Macros structure and tools. I have automated over time many Business Tasks with Lotus 123 and Excel Macros by using as you suggested the Macro Record to obtain the various steps in code format and then assembled the whole thing and polish it.

Looking forward to what ‘s coming next.

Thanking You

Alain de Coriolis

Louanne - April 18, 2018

This is very interesting. Looking forward to the VBA Pro Course

Wouter - April 11, 2018

This is ridiculously cool. Every time you think you have a pretty full understanding of Excel’s functions, something new and amazing shows up. Thanks very much for the video!!

Simona Duball - March 31, 2018

This website is completely gret. I’ve researched these stuffs a great deal and I
realised that is professional, easy to comprehend. I congratulate you because of this research that I’ll recommend to the people friends.
I ask you to visit the
page where each scholar or scholar can calculate ratings grade point average
marks. All good!

Steve - March 7, 2018

Hi Jon,

I missed the last course enrolment.

Can you tell me when your next pro VBA course will start?

In the Pro VBA course is there any help with plotting complicated equations from within VBA into a worksheet leaving the calculation in VBA rather the worksheet?

Many thanks


Joel - January 19, 2018

Hey Jon,
I would be interested in creating VBA as shown in your videos. My concern would be that once I create the VBA code I would like to take this VBA improvements to my work computer and have it available for all of my excel work both at work and home. Since I am creating the VBA inside a workbook how can I store it on my computer and then take it to work with me (or visa versa). I would like to keep all the VBA macros in a folder on the excel toolbar to make them easy to access with the touch of a icon. If you can explain this concept it would be appreciated.

    Jon Acampora - January 22, 2018

    Hey Joel,

    Great question! You could store the file on a cloud drive like Dropbox, Google Drive, or OneDrive. Then access it on any computer that is connected to that drive. I use all of these services and they each allow you to store files in folders on your computer. The folders look like regular folders and they sync whenever you make changes or add/delete files. It’s the easiest way to access files between computers and keep things synced.

    I hope that helps.

Mountaga - January 19, 2018

Hello I wrote back the following in response of an email I received from you Sir Jon. I hope you will read it and respond back as quickly as possible:

“Hello Sir Jon,

I am very interrested about the offer and want to make 3 payements of 99$. But I have never done an online transaction before. I don’t have a mastercard or a paypal card. How can I manage to get you have the money. Because I really want to start the course at the very beginning so that I won’t miss anything. What can I do before it’s too late ?

Thanks and looking forward your response.

NB: I live in Sénégal, a west African country across the Atlantic Ocean. Our currency here is “Franc CFA” (XOF is the code used)”

Albert Mascarenhas - November 10, 2017

Yours videos were clear and concise and well presented. Thanks John and I look forwards to your VBA pro course.

Gretchen - November 4, 2017

I’m using Excel 2010…and lesson 3 doesn’t work but doesn’t give me an error. I am able to initialize the Userform but that is all.

Is it my version of excel?

Thank you

Luuk - November 3, 2017

Nice, I have always wanted to use a form but where afraid to try it. Now I will, thanks!

Burdette - October 10, 2017

Super! Excel is all about saving time and improving accuracy. These Macros showed a way to do both. I can envision a future versions of Excel having some of these functions built into Excel itself.

JP - September 13, 2017

Excellent material. Love it

Satyajit Roychaudhury - August 30, 2017

Excellent video. Very useful.

Agnes - August 14, 2017

Really good. Please do some more series. I would love to see some more topics on automation i.e. Get and Transform data to read in spreadsheets and ways to email and save results.
Thank you.

Paul - June 17, 2017

Thanks Jon! Your lessons are presented in clear, easy to understand modules. I would recommend your training to anyone wanting to learn VBA.

asim siddiq - April 16, 2017

Jon Acampora, your are a Great Teacher!

Scott H. - April 13, 2017

Great teaching!

Catherine - March 13, 2017

Great training video, wish I knew about these courses sooner.

Ken - March 6, 2017

Thanks Jon, this is great stuff! Especially for someone who was scarred by their computer science professors in their college days. I am looking forward to the info on the Pro Course.

Thank you!


Jess - February 21, 2017


Another Great Presentation! I received an error when I ran my code but it ran fine once I made sure none of my sheets were hidden. Go figure! Anyway, thanks and awaiting your email regarding the pro series. It will be nice to use loops in vba than writing long formulas in excel.


    Jon Acampora - February 28, 2017

    Hi Jess,
    Yes, I think I forgot to mention that the sheets will need to be visible in this case. We can also add code to unhide and then hide sheets if the macro needs them to be visible. Not all code for a sheet requires the sheet to be visible.
    I look forward to having you join us for The VBA Pro Course. Thanks again! 🙂

Joan - February 16, 2017

So nice video. I want to learn more about VBA. Thank you very much!

Damiano - February 10, 2017

Hi Jon, your videos are very useful and well explained: a simple and easy way to learn VBA. I’d like to have more info about the VBA Pro Course. Thanks

    Jon Acampora - February 15, 2017

    Thank you Damiano! I really appreciate the nice feedback. I sent you an email with more info on the course. I look forward to having you join us.

Kristina - February 7, 2017

I tried this on a monthly report I sent out. when I got the to ME.

Listbox was not an option, and it keeps giving me an error. I don’t know how to get LISTBOX to show in my choices under ME.

Any helP?

    Jess - February 21, 2017


    Did you rename your listbox object to ListBox_Sheets? I think me. refers to the userform and ListBox_Sheets has to be an object on the userform for it to appear in the drop-down.


kapil - December 27, 2016

Hi John, I want to export data from a workbook.

Like if i am having region data East 1 est 2….. west 2
i want to export it in east 1 sheet… west 1 sheet..

Also i want to learn more. what’s your fee and how can i get video.. please let me know


    Jon Acampora - December 27, 2016

    Hi Kapil,
    Great question. That is a very common task to split data into sheets within the workbook.

    I will be sending you more info about the VBA Pro Course in just a few days. Stay tuned.

Miera - November 13, 2016

Hi Jon,
I am very greatful and delighted of your effort and expertise in excel. I’m a beginner and benefiting greatly from your simply but very indept tutorials.

Thanks again.

PS: cant wait for your VBA Pro course.

    Jon Acampora - November 14, 2016

    Thank you Miera! I look forward to having you join us.

Bernardo moniz da Maia - November 9, 2016

thank you for the explanation. very useful.
i will wait for or next emails regarding the beginner to pro.
best regards

Baliong - November 1, 2016

Thanks John for the Links, I’m still learning and its becoming very interesting, as I do project monitoring and evaluation in my daily work and I look after HIV – AIDS patient database so I’m working on a userform that can help enter data, store data and export data to word or PDF to report to my bosses, I’m still working on it. Every thing was done on assumptions I did not really understand the basic things about macros and VBA code deveopment but I’ve been searching all over the web to see what people have done and try applying for my self thanks alot again John.

Baliong Erewiong - October 31, 2016

I appreciate your efforts, its very helpful on my end because I’m just a begginer and I do project monitoring and Evaluation so I’m beggining to see the importance of excel and VBA

    Jon Acampora - November 1, 2016

    Thanks Baliong! I’m happy to hear it helped.

Don Willhoit - October 12, 2016

Great 3 video intro! Can’t wait for the full course. Thanks.

    Jon Acampora - October 22, 2016

    Thank you Don! I really appreciate your support!

Victor - October 2, 2016

Extremely well explained. Thank you very much!

Best Regards,

Rajan A - August 30, 2016

Hello Jon,
Wonderful explanation. Video in all respects is great.
Request to mail me details of your wonder full learning modules.
Thanks and regards,

YasserKhalil - August 25, 2016

You are a great teacher John. Really wonderful presentation
I am admired of your website


Leave a Reply: