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 did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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,223,911
Messages
6,175,334
Members
452,636
Latest member
laura12345

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