Excel VBA Dictionary: How to use the Dictionary (1/4)

  Рет қаралды 76,064

Excel Macro Mastery

Excel Macro Mastery

Күн бұрын

Пікірлер: 62
@Excelmacromastery
@Excelmacromastery 5 жыл бұрын
Hi everyone. Please enjoy the first video about VBA Dictionary. If you have any comments, please add them below.
@turkaykoc8587
@turkaykoc8587 Жыл бұрын
Your did a very good job, thank you so much for the clear explanations.
@trinhthanhlinh150
@trinhthanhlinh150 5 жыл бұрын
Your explanation is trule comprehensive. Thank you Paul!
@Excelmacromastery
@Excelmacromastery 5 жыл бұрын
Thanks Trinh
@VBAbyMBA
@VBAbyMBA 3 жыл бұрын
So simple but have so many possibilities. Thanks ☺️
@franciscoaugustovarelaagui2443
@franciscoaugustovarelaagui2443 Жыл бұрын
muchas gracias por la clase! Muy claro todo!!
@Up4Excel
@Up4Excel 5 жыл бұрын
Very well explained...and I can see there will be plenty of uses so looking forward to the rest of the series
@gilenomascarenhas6693
@gilenomascarenhas6693 4 жыл бұрын
Oh, man... this is pure gold. Thank you, sir.
@prakashsrinivasan7840
@prakashsrinivasan7840 3 жыл бұрын
Well explained thank you👍👍👍
@sakhilengwenya594
@sakhilengwenya594 4 ай бұрын
Please do an example on mapping data using dictionary and arrays
@virginiacardinalchildsuppo5090
@virginiacardinalchildsuppo5090 3 жыл бұрын
Awesome lecture
@rakeshkumarmadella7955
@rakeshkumarmadella7955 4 жыл бұрын
Thank u so much Paul.. I am getting your emails every day.. your channel is very useful .. very nice wonderful great video.. I really loved it sir
@ryanquinn1257
@ryanquinn1257 2 жыл бұрын
Best excel advice and vids. Perfectly solves a problem trying to count duplicates of a list where I don’t want to sort the list, it has to process in order. I have a SKU name I pull from JSON data and a file i end up downloading where the download is named SKU name for first then SKU name-1 for the second SKU name -2 so on. This allows me to add the SKU as the key, value is duplicateCount starting at 0. If the SKU name hasn’t shown up yet add it to dictionary, Otherwise increment up duplicateCount If duplicateCount is 0 then keep SKU name as SKU, otherwise SKU-duplicateCount
@MyAudioBookCompilation
@MyAudioBookCompilation 2 жыл бұрын
Wow you have a different approach of using and explaining Dictionary. I have been using this for quite sometime but explaining Item like a Value makes it more understandable. I want to learn how to use API and i though your guidance will bring me there. Thank you so much.
@buithitrami175
@buithitrami175 5 жыл бұрын
Thanks Paul! It has been 2 weeks since your last video. Looking forward to more videos soon 😊
@Excelmacromastery
@Excelmacromastery 5 жыл бұрын
Hi Mi. I will be uploading more frequently in the future.
@buithitrami175
@buithitrami175 5 жыл бұрын
Can’t wait 👍🏾
@wattjock2405
@wattjock2405 3 жыл бұрын
I am very grateful to your videos and am learning a lot. I opened the Watch Window and added dict("Apple") to it as shown in video. The Code, the Watch Window, and the Immediate Window all work fine as I Step through (F8) the Code. However; when I then add dict("Orange") to the Watch Window and step through with F8, I get the Error Message that "This Key is already associated with an element of this Collection". But... if I use F5 to simply run the code, everything runs and the Immediate Window prints out all the correct Values. What am I missing?
@Excelmacromastery
@Excelmacromastery 3 жыл бұрын
This is actually a bug with the Dictionary. If you add an item in the watch window it gets added to the Dictionary. It caught me out a few times before I discovered it.
@wattjock2405
@wattjock2405 3 жыл бұрын
@@Excelmacromastery ~ thanks... thought I had written the Code incorrectly. Yes, I write all of the Code as you present it "for the practice".
@vikuedutech5061
@vikuedutech5061 3 жыл бұрын
Really wonderful and i have made a real dictionary in excel userform ..
@thearchibaldtuttle
@thearchibaldtuttle 5 жыл бұрын
Nice, never used the watch window this way!
@Excelmacromastery
@Excelmacromastery 5 жыл бұрын
Thanks. It's a nice way of demonstrating the values in the variables.
@raulleopoldobini6831
@raulleopoldobini6831 2 жыл бұрын
Hi! can you teach us how yo create a dictionary of collections of class collections?
@dmp7252
@dmp7252 3 жыл бұрын
Is there a spot where we can see what the end-product looks like?
@wayneedmondson1065
@wayneedmondson1065 5 жыл бұрын
Hi Paul.. great intro to using a Dictionary.. looking forward to more. I see below you've mentioned about early and late binding. So, if you are going to distribute your code to users who might not have a reference to the Scripting Runtime, then you early bind while you write the code (for Intellisense) and then modify the code to late bind (Dim dict and Set dict=CreateObject("Scripting.Dictionary")) before distribution? That seems like the logical approach..yes? Thanks for the inspiration to think and create. Thumbs up!
@Excelmacromastery
@Excelmacromastery 5 жыл бұрын
That's exactly right Wayne. For distribution it is always better to use late binding.
@wayneedmondson1065
@wayneedmondson1065 5 жыл бұрын
@@Excelmacromastery Thanks Paul.. loving your videos and KZbin channel. BTW, on your channel, take a look at the View Full Playlist for Excel VBA Collections. It looks like someone inserted a 6th video into the list.. not related to VBA.. maybe some kind of a hack.. don't want to click on it.. but it definitely looks like it does not belong there. Thought you would want to know and delete it or report it to KZbin. Thanks again!
@Excelmacromastery
@Excelmacromastery 5 жыл бұрын
Thanks Wayne. I removed that video. All is good now.
@sebastienantunes9668
@sebastienantunes9668 3 ай бұрын
Very useful video ! I was surprised by following the intellisense dict.Add(“Apple”,60) does not work but if I write dict.Add “Apple”,60 then it's ok The intellisense misled me. What is the difference between the 2 writings? Thanks ...
@OmkarUmbre
@OmkarUmbre 5 жыл бұрын
Hi you shown how to add elements to the dictionary, can you please explain the purpose /use of the added elements.
@andyalmanza1517
@andyalmanza1517 2 жыл бұрын
Hi, great video. I ran into a problem I'm hoping you can help with. I added the Microsoft Scripting Runtime reference and created my dictionary variable the same way you did. However, the "Add" method is not available for my dictionary, why would that be?
@dangelorrrr
@dangelorrrr 5 жыл бұрын
Hi Paul - you need to edit your above video description... "In this Excel VBA video, we see how to use Class modules objects with Collections. One of the problems with collections is that it can only store one item from a row of data. So how to we store data from multiple columns? We use class module objects. "
@Excelmacromastery
@Excelmacromastery 5 жыл бұрын
Thanks for pointing that out. Updated it now.
@bobkaplan251
@bobkaplan251 5 жыл бұрын
I thank you for explaining this so well as I've wondered for years what it did or was. But, I'm puzzled as to where I might use it. For example, I have a price list with 3,000+ items on it that I use repeatedly. I know the item number (key) so I've just been inputting that in the Excel Find option. Is there maybe some better way to use the dictionary to do this?
@Excelmacromastery
@Excelmacromastery 5 жыл бұрын
Good to hear from you Bob. If you have a low frequency of finds e.g. manually finding the Excel Find is fine. For a high frequency though, the Excel Find is slow. For example, imagine you had a second list of 1000 items and you had to look up these in the first list. Then the dictionary would be very useful. You can see some examples at the bottom of this post: Excel VBA Dictionary(excelmacromastery.com/vba-dictionary) Show less
@Kralnor
@Kralnor 4 жыл бұрын
One major benefit of using a Dictionary is that lookups take constant time. That is, it doesn't matter how large the Dictionary is, looking up a certain key will always be practically instant. This is unlike arrays where you need to scan through the array.
@thescharfies3723
@thescharfies3723 Жыл бұрын
top !!
@virtreal4663
@virtreal4663 3 жыл бұрын
How add to dictionary other dictionaries?
@H2Dwoat
@H2Dwoat 5 жыл бұрын
Hi, I saw you added the dictionary from the reference library. Do all users then have to add it to make use of the workbook?
@Excelmacromastery
@Excelmacromastery 5 жыл бұрын
In practise is better to use Late Binding(i.e. CreateObject) instead of the reference when distributing to other users.
@UncleChopChop22
@UncleChopChop22 5 жыл бұрын
Hi thanks for the video.i see It is 1 of 5. Will the other be far away as I noticed others are being released.
@Excelmacromastery
@Excelmacromastery 5 жыл бұрын
Hi next Dictionary video will be released in the next 2 or 3 weeks.
@UncleChopChop22
@UncleChopChop22 5 жыл бұрын
@@Excelmacromastery no worries. Look forward. Hope you stick to the vids. Been enjoying them. Easier to watch then some of the other drawn out vids on here.👍
@venusflytrap909
@venusflytrap909 3 жыл бұрын
Is there a method to apply a Like comparison to the value in the dictionary i.e. Dict item is "Shower" but like comparison would be Shower1 or Shower 2 etc - I have tried with no success adding wildcard to the dict item
@savaliyanirav9680
@savaliyanirav9680 2 ай бұрын
My dictionary object always has one empty item in it. Also, I cannot remove that "Item 1" using : If Dict.Exists(" ") Then Dict.Remove " " ....... What is the solution?
@rrrprogram8667
@rrrprogram8667 5 жыл бұрын
Keep calm and learn vba
@Excelmacromastery
@Excelmacromastery 5 жыл бұрын
:-)
@mrbubetube
@mrbubetube 2 жыл бұрын
I think the Peter Norton look went out with the 1980s dude
@susantakumar8330
@susantakumar8330 5 жыл бұрын
Hi Paul, I used late binding but I am getting object can't be created error message in office 365. Is there any solution? I can't use early binding bcz I need to distribute the Xlam file to my team.
@kingpin11111
@kingpin11111 4 жыл бұрын
Make sure you write set dict = CreateObject("Scripting.Dictionary") and not just set dict = CreateObject("Dictionary")
@arkabose1102
@arkabose1102 4 жыл бұрын
what if I want to add multiple values to a key in a dictionary? Like in python, I use key.append(xyz). How to do that in vba dictionary?
@ryanquinn1257
@ryanquinn1257 2 жыл бұрын
Your dictionary value probably ends up being a variant array or another collection or dictionary depending on use case. That kinda how my nested Jsons end up working
@enricomendiola9952
@enricomendiola9952 3 жыл бұрын
Hello Sir, If I have this kind of data how can I do it using Dictionary: Column Headers P1 with phone numbers P1 Type : Cell or Landline or Voip P1 Old: Yes or No Phone1, P1 Type, P1 Old, Phone2, P1 Type, P2 Old up to Phone10 Output Sheet1 Delete rows with P type: Voip Delete values with Type: Cell and Old: Yes Output Sheet2 From the original sheet Retain only Type: Cell and Old: Yes Then: if column Phone1, type and old has blank records cut and paste from Phone2, type2, old2 and so on to fill in blanks Can this be achieve using dictionary Sir?
@flemsflems4630
@flemsflems4630 4 жыл бұрын
How can I write a formula in an excel cell to extract 1 item from the dictionary by using the key? I would think you you write something like this in a cell =(DD.name,key,position) then Apple would be in one cell.
@furzkram
@furzkram 5 жыл бұрын
The audio level is on the edge of distortion. Remux and take it down by 20% please.
@ObeyyShadesz
@ObeyyShadesz 3 жыл бұрын
very confusing
Excel VBA Dictionary vs Collection (2/4)
8:37
Excel Macro Mastery
Рет қаралды 41 М.
Excel VBA: Practical Guide to Start Using Dictionary [4 Awesome Examples]
25:47
БАБУШКА ШАРИТ #shorts
0:16
Паша Осадчий
Рет қаралды 4,1 МЛН
Как Ходили родители в ШКОЛУ!
0:49
Family Box
Рет қаралды 2,3 МЛН
How to use Class Modules with the VBA Dictionary
14:30
Excel Macro Mastery
Рет қаралды 53 М.
5 More things I wish I Knew When I Started Using Excel VBA
13:31
Excel Macro Mastery
Рет қаралды 72 М.
Excel VBA Introduction Part 39 - Dictionaries
26:24
WiseOwlTutorials
Рет қаралды 60 М.
How to Use Arrays Instead of Ranges in Excel VBA
10:20
Excel Macro Mastery
Рет қаралды 207 М.
What is Dictionary in Excel VBA
14:04
Dinesh Kumar Takyar
Рет қаралды 6 М.
Learn Excel MACROS in 10 Minutes Using Real World Examples
9:13
Kenji Explains
Рет қаралды 1,2 МЛН
5 Things I wish I knew When I started using Excel VBA
12:45
Excel Macro Mastery
Рет қаралды 341 М.
Use This Trick to Automate Any Excel Task (Better Than Macros)
10:53
Kenji Explains
Рет қаралды 136 М.
How To Master Arrays In Excel VBA + FREE MACROS & CHEAT SHEET
29:09
Excel For Freelancers
Рет қаралды 10 М.
БАБУШКА ШАРИТ #shorts
0:16
Паша Осадчий
Рет қаралды 4,1 МЛН