Excel ActiveX Combo Box to Select Worksheets with VBA

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

You can make data entry easier by letting users choose a value from a combo box. A combo box combines a text box with a list box to create a drop-down list.

You'll learn how to create a handy navigation combo-box for your Excel workbooks. The ActiveX combobox is automatically filled with the sheet names of your open workbook. If you add sheets, these are automatically added to the drop-down box. Deleted sheets are automatically removed from the combo-box.

What you learn in this video:
- User-Friendly Macro: A step-by-step guide to crafting an Excel macro that significantly improves navigation in extensive workbooks.
- Dynamic Combo Box Creation: We'll show you how to add a combo box that lists all worksheets, updating itself whenever you add, delete, or rename a sheet.
- Interactive and Automated: Learn to make the combo box fully dynamic, eliminating the need for manual updates.
- Simple Coding Explained: Follow along as we delve into basic coding in Excel, including using ActiveX controls and worksheet activate events.
- Problem-Solving Tips: Encounter common issues like duplicated entries and empty combo boxes? We'll teach you how to solve these efficiently.
- Enhanced User Experience: Make your workbook more intuitive with custom messages and navigation aids in the combo box.
- Workbook Open Event: Ensure your macro runs smoothly even when reopening your workbook by setting a workbook open event.

★ Links to related videos: ★

🚩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!

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

I already knew this method, but your videos are so well done that I watch them even if (sometimes) they're nothing new for me. I think your explanations are very clear and useful also for Excel beginners.

danielemerli
Автор

Extremely helpful as are all your videos. I made one small addition. Because I often use a hidden "settings" sheet, I added this to cbSheet.AddItem:
If Sh.Visible Then
Me.cbSheet.AddItem Sh.Name
End If

jimbarton
Автор

Very nice. Thank you, Leila. The only issue I had was if I added the code to put "Select Sheet" in it crashed every time. It would go to the sheet but then give me an out-of-range error. I checked my code 5-6 times and, near as I could tell, it was right. I'm sure it's something I'm doing wrong on my end though.

Your tutorials are great! Not 2 hours long so easy to stop and start and get it going.

TradShowTom
Автор

I have the exact requirement and looking for solutions on various websites. Nothing helped except this one. Thank you so much

Suryaprakash-uyng
Автор

Love how you bring up problems that arise, so that the viewers can get a deeper understanding. Awesome video!!

greggowaffles
Автор

What is that? Simply stunning. Brilliant ideas. I fell in love with Excel after seeing such useful tutorials. I do not want to stop learning from you. Thanks

sasavienne
Автор

I didn't even realize that I wanted this, but now I must have it! Great presentation! The workbook seems to be missing though.

caseyjohnston
Автор

Thank you for sharing Leila. . Maybe you do that intentionnally but I would combine the procedures (write the code) in a way that avoid the switch to another sheet and coming back to run the macro if the workbook open on the ActivateX Sheet.

mehdihammadi
Автор

You are the best Leila thanks so much for all your videos

yemisiadeoluwa
Автор

This is very useful; It' is what I was looking for. You're great Leila, thanks

Galileopi
Автор

Love your work, excellent teaching and now I use this on all my forms and it works brilliantly. Really Love your work Leila and would like to now learn how to activate more selections from 1 sheet to another.

Mick-qqpi
Автор

I really love your video. You explained clearly.

sanneng
Автор

really awesome video. but if you right click on the sheet navigation arrows on the bottom left of the window, you get a pop up list of all the sheets in the workbook that essentially does the same thing.

vegaswould
Автор

Sorry.. I was able to download it - thanks! You are an expert; but more.. an excellent teacher!!

errolwirasinghe
Автор

Hi Leila i need your help. I am applying what you taught on multiple worksheets. I have a hundred of worksheet. Is there a way to have a search function with that combobox?

gabriellecajurao
Автор

THANK YOUUUU! I don't need the combo box, but I've been trying to figure out how to make sure my file opens to my dashboard every time it's opened and I think that last segment answers that. Now I'm kicking myself for leaving my laptop in my office so I have to wait until tomorrow to try it.

gregsdoodles
Автор

Thanks Leila, I'm learning very much with your Videos. Since I found your channel I visit it every day. I have an observation, since the the ComboBox is dynamic, what if the user delete the worksheet "Data" that is used at the open event. It´s better to use something like this ...


Private Sub Workbook_Open()
Dim SH As Worksheet

temp = ""
For Each SH In ThisWorkbook.Worksheets
If SH.Name <> "ActiveX" Then temp = SH.Name
If temp <> "" Then GoTo salir
Next SH

salir:

If ActiveSheet.Name = "ActiveX" Then
Worksheets(temp).Activate

End If
End Sub

rajaelrajon
Автор

Very useful and easy to create. Thanks.

xaquison
Автор

Hi Leila.
Thank you for all your VBA Videos. I have been using many of your VBA Codes quite a while now. Recently I have used your code of this video and achieved what I was willing to. However, as an additional feature, I wrote code to first unhide the sheet based on ActiveX selection but failed to re-hide the same sheet again when ActiveX sheet is reselected after relevant data entry. Below is my attempted code:

Private Sub cbSheet_Change()
If CBSheet.Value <> "Select a sheet" Then
= True

If Worksheets("ActiveX").Select = True Then
= False
End If
End If
CBSheet.Value = "Select a sheet"
End Sub

HiteshPatel-hqlt
Автор

Thank you very much Leila for your time and cool video!

jokkiossaka