Problem in understanding vba code

dylanpong

New Member
Joined
Dec 23, 2015
Messages
6
Hello everyone,

I am new to excel <acronym title="visual basic for applications">vba</acronym> and try to work on some lookup problems. I have searched for some previous post and find one of it is useful in my problems. Here's the link:VBA Macro multiple value lookup

I can successfully generate the result but have difficulty in understanding the coding. Theres a term
.Add Dn.Value, Array(n, 2)
within the coding. I have done some research and believe that this statement is to adding content into the dictionary. However, i am not quite sure why the terms Array(n,2) is used in this coding
Also in the other line, theres a term
Q = .Item(Dn.Value)
, but in the next line it uses Q(1) and Q(0) instead, i cannot understand what the line is doing.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
The item being added is an array. That's why you can use Q(0) and Q(1) later to access the elements.
 
Upvote 0

Forum statistics

Threads
1,216,106
Messages
6,128,863
Members
449,473
Latest member
soumyahalder4

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top