VBA UI UX-16: How to use powerful TreeView Control in Excel UserForm

  Рет қаралды 38,843

VBA A2Z

VBA A2Z

Күн бұрын

This series covers how to design a Professional User Interface using Office Apps.
Subscribe, Like, and Comment. 🙏Thanks for watching.
You can now support by buying any of the Projects or Source Code.
📥Downloads: pamaitech.com/...
👍 Support: paypal.me/pama...
✉️ Contact: contact@pamaitech.com
📌What to watch next:
Playlist: www.youtube.co...
Videos: www.youtube.co...
#VbaA2z

Пікірлер: 119
@scotolivera8207
@scotolivera8207 4 жыл бұрын
God bless you, I can only imagine how much time I took you to learn all this trick and skills
@brenthalbach3645
@brenthalbach3645 2 жыл бұрын
This is absolutely awesome! I have tried to find an example of this for a long time with no luck. You have explained it very well in your video, I think I finally have a basis to start on a Treeview. Thank you for all your amazing video content.
@VBAA2Z
@VBAA2Z 2 жыл бұрын
Thank you!
@hericklenin
@hericklenin 4 жыл бұрын
Genius! Sometimes we can find gold in youtube and your videos are gold. Thanks! I would like to learn how to parse Excel formulas like that. Are you going to discuss that?
@VBAA2Z
@VBAA2Z 4 жыл бұрын
Thanks for your kind words. Sure we can discuss that formula parse in upcoming videos. If you haven't, please do not forget to subscribe to my channel for upcoming videos. Regards.
@wikamdiopekiang4972
@wikamdiopekiang4972 2 жыл бұрын
Easy to understand and very helpful - thank you
@VBAA2Z
@VBAA2Z 2 жыл бұрын
Great to hear!
@ExcelForFreelancers
@ExcelForFreelancers 8 ай бұрын
Great training. Thanks so much. I am thinking Customers: Invoices: Invoice Items. I will try to put it together for a training. Thanks again
@VBAA2Z
@VBAA2Z 7 ай бұрын
Thanks for visiting sir!
@djunabug
@djunabug 3 жыл бұрын
Amazing! You are a wizard, and a generous one at that :)
@VBAA2Z
@VBAA2Z 3 жыл бұрын
Thank you kindly!
@Petrick-ri3sq
@Petrick-ri3sq Жыл бұрын
another great episode thanks!
@VBAA2Z
@VBAA2Z Жыл бұрын
Glad you enjoyed it
@user-oy3zj3zr2w
@user-oy3zj3zr2w Жыл бұрын
thanks again Pamai
@VBAA2Z
@VBAA2Z Жыл бұрын
you're welcome
@Penbam
@Penbam 5 ай бұрын
Wow your channel is just amazing.
@VBAA2Z
@VBAA2Z 5 ай бұрын
Thank you so much 😀
@atingnewmai3680
@atingnewmai3680 4 жыл бұрын
Achi you are GENIUS.
@octaviopinto2809
@octaviopinto2809 3 жыл бұрын
Excellent examples and explanation. Easy to follow
@VBAA2Z
@VBAA2Z 3 жыл бұрын
Glad it was helpful! thanks for watching.
@bnancy3699
@bnancy3699 4 жыл бұрын
This is really informative. thanks for sharing your knowledge.
@VBAA2Z
@VBAA2Z 4 жыл бұрын
Glad it was helpful!
@octaviogomespinto3383
@octaviogomespinto3383 3 жыл бұрын
Excellent. Thank you very much
@VBAA2Z
@VBAA2Z 3 жыл бұрын
Glad it was helpful! thanks for watching.
@gustavobarella3940
@gustavobarella3940 2 жыл бұрын
Thanks for the exemple!
@VBAA2Z
@VBAA2Z 2 жыл бұрын
My pleasure!
@gustavobarella3940
@gustavobarella3940 2 жыл бұрын
@@VBAA2Z i requer this example from your site, could you please send to me? Thanks
@holieh5301
@holieh5301 3 жыл бұрын
Brilliant! Thanks
@VBAA2Z
@VBAA2Z 3 жыл бұрын
Glad you liked it!
@wennychez5606
@wennychez5606 4 жыл бұрын
Great tutorial. Thank you so much
@VBAA2Z
@VBAA2Z 4 жыл бұрын
Glad you enjoyed it!
@ricardoevandropereiradeoli9028
@ricardoevandropereiradeoli9028 4 жыл бұрын
Excelente conteúdo, muito obrigado por compartilhar o seu conhecimento.
@user-ll8up1eu4d
@user-ll8up1eu4d Жыл бұрын
Its a great explanation. Thank you.
@VBAA2Z
@VBAA2Z Жыл бұрын
Glad it was helpful!
@JoshKingiu
@JoshKingiu Жыл бұрын
thank you
@VBAA2Z
@VBAA2Z Жыл бұрын
You're welcome
@ekilunewmai7033
@ekilunewmai7033 Жыл бұрын
Thanks
@VBAA2Z
@VBAA2Z Жыл бұрын
No problem
@manfredphol3732
@manfredphol3732 3 жыл бұрын
The Video is very helpful, it would be nice if there was a description when an action is executed when child is clicked
@VBAA2Z
@VBAA2Z 3 жыл бұрын
check Private Sub TreeView1_Click() in project.
@manfredphol3732
@manfredphol3732 3 жыл бұрын
@@VBAA2Z Sorry, I can't find the source code / download the project 😢
@VBAA2Z
@VBAA2Z 3 жыл бұрын
@@manfredphol3732 be sure to check your spam folder
@edwardpaulbangura
@edwardpaulbangura Жыл бұрын
This is superb.🥰😍
@VBAA2Z
@VBAA2Z Жыл бұрын
thanks
@andreasmusic1222
@andreasmusic1222 2 жыл бұрын
Very helpful tutorial! I believe the way it's set up now however is that if there's a city with the same name in another country, it'll only add it once. What do you suggest as a workaround for this? I thought about setting the key to the full path of each item, e.g. the key for New York in USA would be "North America\USA\New York City", and the key for New York in another country would be "North America\Canada\New York City". It's obviously a not realistic bad example but I hope you know what I mean. Let me know your thoughts.
@VBAA2Z
@VBAA2Z 2 жыл бұрын
Good point. perhaps create a unique ID with Country, City and ZipCode and display text can be duplicated
@williamarellano9586
@williamarellano9586 3 жыл бұрын
Hello, it's a great explanation, thanks, sorry the link provided is no longer available?
@VBAA2Z
@VBAA2Z 3 жыл бұрын
Thanks! Please refer to 024 VBA UI UX-16: How to use powerful TreeView Control in Excel UserForm vbaa2z.blogspot.com/2020/12/you-can-support-vba-a2z-by-simply.html
@williamarellano9586
@williamarellano9586 3 жыл бұрын
@@VBAA2Z thanks 🙂
@VBAA2Z
@VBAA2Z 3 жыл бұрын
@@williamarellano9586 Most welcome, thanks for watching.
@Noune-fp2qr
@Noune-fp2qr Жыл бұрын
Thanks for another very useful video
@VBAA2Z
@VBAA2Z Жыл бұрын
You're very welcome!
@dssabnis
@dssabnis 2 жыл бұрын
great code.. good contribution.
@VBAA2Z
@VBAA2Z 2 жыл бұрын
Thanks!
@alessandrolazzarini270
@alessandrolazzarini270 Жыл бұрын
Hi Lung Pamai! Thank you for your videos, they are helping me a lot! I'm solving how to click on parent checkbox for having all children checkboxes clicked? There is a video you handled this topic? Many thanks.
@VBAA2Z
@VBAA2Z Жыл бұрын
Glad to hear!
@jaspeeg
@jaspeeg 3 жыл бұрын
Great tutoria
@VBAA2Z
@VBAA2Z 3 жыл бұрын
Thanks!
@dinawangjkiu9712
@dinawangjkiu9712 Жыл бұрын
excellente
@VBAA2Z
@VBAA2Z Жыл бұрын
Thank you, Cheers!
@gustavogoncalves8337
@gustavogoncalves8337 2 жыл бұрын
Hi Lung Pamai! First of all, thank you so much for your high quality videos! It's helping me a lot in my projects. They are motivating me to start programming and I am really enjoying it =) I have one question regarding multiple users in a single UserForm in Excel. Is it feasible to have around 4 users o the same userform to input, update and delete data from the same workbook? I did not test it yet but it could be a problem according to some search in internet. In my case, all users have the 365 license. Thanks a lot!
@VBAA2Z
@VBAA2Z 2 жыл бұрын
That is feasible, create/keep frontend ( Userform ) and database/workbook separate. Users can open the frontend from their respective computer.
@Faizht
@Faizht 3 жыл бұрын
Where can I download the Formula Treeview utility you have showed at the start of the video? This could be really useful! Keep up the great work, your videos are a great learning tool!
@VBAA2Z
@VBAA2Z 3 жыл бұрын
I'll try and cover how to create one in upcoming videos.
@TyiZeak
@TyiZeak Жыл бұрын
@@VBAA2Z Have you made this video yet, As I cannot find it in your videos.
@TyiZeak
@TyiZeak 10 ай бұрын
​@@VBAA2Zany update?
@brentmawhinney5703
@brentmawhinney5703 8 ай бұрын
Excellent video and explanations. Likewise the Formula Treeview Utility form build would be a very worthy item to have. Please do an addendum to this video and show the build for the Formula treeview. For me it would worthy of download from your website. I checked there to see if it was available, but no luck. I've subscribed to keep an eye on the VBA work you've done and are doing.
@lehuynhuc6492
@lehuynhuc6492 3 жыл бұрын
Good project Sir
@VBAA2Z
@VBAA2Z 3 жыл бұрын
Thanks
@brenthalbach3645
@brenthalbach3645 2 жыл бұрын
Do you have any videos on loading a Treeview directly from a sql recordset?
@VBAA2Z
@VBAA2Z 2 жыл бұрын
no, not in channel yet
@jademitchell4992
@jademitchell4992 2 жыл бұрын
Download for this item does not appear to be available?
@VBAA2Z
@VBAA2Z 2 жыл бұрын
It should be in the list
@BloominOnion1
@BloominOnion1 Жыл бұрын
hmmm what if I have two keys of the same name, but under different parents? It's throwing an error. Thanks for the great help.
@VBAA2Z
@VBAA2Z Жыл бұрын
Key must be unique in collection
@reeggiee
@reeggiee Жыл бұрын
Hello, thank you for the tutorial. I can't seem to be able to find it on your website. Could you please PM me the link?
@VBAA2Z
@VBAA2Z Жыл бұрын
Most welcome. Here's the link vbaa2z.blogspot.com/2020/12/you-can-support-vba-a2z-by-simply.html
@astigxtutorials
@astigxtutorials 3 жыл бұрын
Hi, is it possible to select a node then it will use the selected node as a filter to another table? Then it will show for example the sales of that node.
@VBAA2Z
@VBAA2Z 3 жыл бұрын
yes you can. Transfer all items for selected node and transfer to array and use it to apply filter.
@firstcommenter202
@firstcommenter202 3 жыл бұрын
what is the maximum number of nodes this control can have?
@JonathanFox-kl1lu
@JonathanFox-kl1lu Жыл бұрын
I'm attempting to apply this to my own workbook, but each time I do it, re-do it, lookup new methods, no matter what I try I seem to keep getting this "User-defined type not defined" compile error. I've followed the video step for step with the only real difference being the number of sheets I have in my file and the columns I am using (in this case columns A through C). I'm currently sitting at time frame 24:34+ after entering the sub name, trying to run it the exact same way he did. Is this a common issue for anyone else? Code: Option Explicit Public EntityOwnershipData() As Variant Sub laodTvDATA() Dim dic As Scripting.Dictionary Dim dkey As Variant Dim ArrIndx As Long Set dic = CreateObject("Scripting.Dictionary") EntityOwnershipData = Range("A2:B121") UserForm1.TreeView1.Nodes.Add , , "Primary", "Primary" For ArrIndx = 1 To UBound(EntityOwnershipData) If Not dic.Exists(LCase(EntityOwnershipData(Arr.Indx, 1))) Then dic.Add LCase(EntityOwnershipData(Arr.Indx, 1)), Nothing UserForm1.TreeView1.Nodes.Add "Primary", tvwChild, EntityOwnershipData(ArrIndx, 1), EntityOwnershipData(ArrIndx, 1) End If Next ArrIndx End Sub Command button code: Private Sub CommandButton5_Click() With Me.TreeView1 .Appearance = ccFlat .CheckBoxes = True .LineStyle = tvwRootLines .Nodes.Clear End With laodTvDATA End Sub Let me know if anyone else is having this issue or if you need further information about the file to understand my situation.
@VBAA2Z
@VBAA2Z Жыл бұрын
Please be sure to add a reference.
@JonathanFox-kl1lu
@JonathanFox-kl1lu Жыл бұрын
@@VBAA2Z Alright so I found and corrected the issue. For those interested, I decided to dim dic as and object then set dic = a scripting dictionary. Sub laodTvDATA() Dim dic As Object 'Here Dim dkey As Variant Dim ArrIndx As Long Set dic = CreateObject("Scripting.Dictionary") 'And here (already included) EntityOwnershipData = Range("A2:B122") However, I did run into some more issues/wants that I couldn't immediately figure out just after some brief internet digging. Now when I attempt to add my third column data it gives me an "Out of range" error. From what I can gather it may be due to the formatting of the data being percentages? I'm not really sure, but if you know where I could go to solve this issue or better yet place the percentages alongside the companies in my dataset it would work wonders. For context: ABC Co. owns XYZ Co. ownership % is 30% ABC Co. (parent) -XYZ Co. 30% (child) Also, another feature you might incorporate in like a short video or something would be a way to expand all of the boxes instead of having to manually open each one. I would find this very helpful for my case. Otherwise, you've made great and helpful content and by far the most inclusive/relevant video I could find on the web. Thanks a ton!
@amitshah1008
@amitshah1008 3 жыл бұрын
goodone
@VBAA2Z
@VBAA2Z 3 жыл бұрын
thnks Amit
@djunabug
@djunabug 3 жыл бұрын
With all your UI prowess, have you found a way to change colors of TreeView Controls?
@VBAA2Z
@VBAA2Z 3 жыл бұрын
So sure I understand. Any specific control?
@djunabug
@djunabug 3 жыл бұрын
Your thumbnail for this video appears to show a TreeView with a purple background. Is this correct? And was it set using code? I can’t find any color settings via the control properties window.
@VBAA2Z
@VBAA2Z 3 жыл бұрын
Thumbnails are for representational purposes only. For custom TreeView we can use labels and images to create one like that however it'll not be dynamic as actual TreeView control
@brayanangelpalmafrias109
@brayanangelpalmafrias109 3 жыл бұрын
Good afternoon, please post a video hoy I can search for a data within a treeview
@simonnartpok6802
@simonnartpok6802 4 жыл бұрын
Hello sir, 'm looking for .NET c# or vb how to add child to parent by specifying the parent id or name. please guide. thanks.
@VBAA2Z
@VBAA2Z 4 жыл бұрын
it is not straightforward as it is VBA. try below. vbaa2z.blogspot.com/2020/07/net-treeview-add-child-node-to-existing.html
@imranbhatti8580
@imranbhatti8580 3 жыл бұрын
Nice Lung Pamai! Is it supported both in 32 and 64 bit Excel?
@VBAA2Z
@VBAA2Z 3 жыл бұрын
Yes it does. I use 64bit Excel / O365 WIn10
@imranbhatti8580
@imranbhatti8580 3 жыл бұрын
Perfect! Also I was afraid of painull registering with regsvr for calendar control and it was producing error on user's pcs.
@momosolo630
@momosolo630 2 жыл бұрын
I need source please
@VBAA2Z
@VBAA2Z 2 жыл бұрын
please check video desc.
@SuperDavidFz
@SuperDavidFz 2 жыл бұрын
Como fazer Treeview interagir com multipage?
@VBAA2Z
@VBAA2Z 2 жыл бұрын
not sure I understand
@SuperDavidFz
@SuperDavidFz 2 жыл бұрын
@@VBAA2Z how to use treeview with multipage?
@VBAA2Z
@VBAA2Z 2 жыл бұрын
are you not able to add TreeView under multi page?
@SuperDavidFz
@SuperDavidFz 2 жыл бұрын
@@VBAA2Z I already got it, thanks you some much
@user-su3bd6hc6s
@user-su3bd6hc6s Жыл бұрын
Hi great video, and amasing what you can do with treeview. But i get the Error Run-Time Error '35603' Invalid Key every time. Sub GetPVData() Dim dic As Scripting.Dictionary Dim dKey As Variant Dim ArrIndex As Long Set dic = CreateObject("Scripting.Dictionary") PVData = Range("C4:e500") UserForm1.TreeView1.Nodes.Add , , "PV", "PV" For ArrIndex = 1 To UBound(PVData) If Not dic.Exists(LCase(PVData(ArrIndex, 1))) Then dic.Add LCase(PVData(ArrIndex, 1)), Nothing UserForm1.TreeView1.Nodes.Add "PV", tvwChild, PVData(ArrIndex, 1), PVData(ArrIndex, 1) End If Next ArrIndex End Sub Can someone maybee assist what is wrong?
@VBAA2Z
@VBAA2Z 11 ай бұрын
The "Run-Time Error '35603' Invalid Key" typically occurs in VBA when you're trying to add a key to a Dictionary that already exists. In your code, you are attempting to add keys to the Dictionary dic, and it seems that there may be duplicate keys in your data, causing this error.
@user-co9lc8yg2x
@user-co9lc8yg2x 8 ай бұрын
I'm sorry. You're explaining to yourself not to others
@VBAA2Z
@VBAA2Z 7 ай бұрын
I get that sometime
@klinkmanuel
@klinkmanuel 3 жыл бұрын
thank you
@VBAA2Z
@VBAA2Z 3 жыл бұрын
You're welcome
@BachXuanHien
@BachXuanHien 2 жыл бұрын
Thanks
@VBAA2Z
@VBAA2Z 2 жыл бұрын
Welcome
@cigalahdn4676
@cigalahdn4676 2 жыл бұрын
Thanks
@VBAA2Z
@VBAA2Z 2 жыл бұрын
Welcome
Date picker for Excel with VBA code
23:34
Rad Sheets
Рет қаралды 135 М.
Dad gives best memory keeper
01:00
Justin Flom
Рет қаралды 21 МЛН
大家都拉出了什么#小丑 #shorts
00:35
好人小丑
Рет қаралды 84 МЛН
How Does VBA TreeView Control Work
6:09
VBA4Excel
Рет қаралды 2,6 М.
This ONE VBA Hack Will Save You Hours on Excel
29:09
Victor Chan
Рет қаралды 10 М.
How to Customize Controls in Excel VBA
18:23
Excel Macro Mastery
Рет қаралды 13 М.
Do You Need to SWITCH from Excel VBA Macros to Office Scripts?
13:02
Leila Gharani
Рет қаралды 380 М.
UI | UX Designer Top with Excel VBA
36:20
Ricardo Camisa
Рет қаралды 26 М.
Multistep userform design in excel | Advanced excel
34:22
Excelyst
Рет қаралды 25 М.
How to run UserForm in Full Screen Mode in Excel and VBA
11:00
TheDataLabs
Рет қаралды 37 М.
Dad gives best memory keeper
01:00
Justin Flom
Рет қаралды 21 МЛН