How to measure or manage .add lines in Scripting.dictionary?

Alex20850

Board Regular
Joined
Mar 9, 2010
Messages
146
Office Version
  1. 365
Platform
  1. Windows
Is there a way to determine how many .add lines can be active?
Is there a way to increase the number of .add lines?

Function BackandForth(ByVal str As String) As String
With CreateObject("Scripting.Dictionary")
.Add "Alaska", "AK"
.Add “AK”,”Alaska”
If .exists(str) Then BackandForth = .Item(str)
End With
End Function
 
Re: How to Have Formula Get and KEEP Data with Vlookup

Sorry, I am not familiar with VBA. What would it look like?
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Re: How to Have Formula Get and KEEP Data with Vlookup

In a new workbook, create a range name

MyTable: =A2:B8


Book1
AB
1HASCFIPS
2US.AK.AE31011
3US.AK.AN27129
4US.AK.AW51650
5US.AK.BE55135
6US.AK.BR54081
7US.AK.DE17031
8US.AK.DI36049
Sheet1


In a code module (and assuming Sheet1 is the code name for the worksheet where you've stored MyTable):

Code:
Function GetFromMaster(s As String, Col As Long) As Variant

    GetFromMaster = Application.VLookup(s, Sheet1.Range("MyTable"), Col, 0)

End Function

Save the workbook as an Excel Add-in, e.g. assuming you have Excel 2007 or more recent, as say, MyAddIn.xlam

Use File/Options/Add-ins/Manage Excel Add-ins/Go ...

to instal your Add-in.

Then on opening Excel, you should be able to call your GetFromMaster function from any workbook.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,945
Messages
6,127,856
Members
449,411
Latest member
adunn_23

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