Personal Workbook Macro Punlic Dictionary Set Up [vba]

DataBlake

Well-known Member
Joined
Jan 26, 2015
Messages
781
Office Version
  1. 2016
Platform
  1. Windows
I want to create some dictionaries that i can access in any workbook.
I.E a list of colors as the key and a list of shortened versions of that color.

Gloss Black White Trim = key
Black = Value

i have a sheet with these values that i would like to establish as a disctionary
A: will this work if i set this vba code publicly dim the dictionary object in my personal workbook?
B: i'm pretty new to setting up dictionaries so how can i convert a sheet *key in Column A, value in Column B* to a dictionary effectively?
C: if possible is this something i can keep updated?

the plan is i open a vendor's data sheet and they have weird color names or other similar problem and instead of doing a 60,000 item vlookup i could just use arrays and dictionaries to change values in the sheet with a vba sub
 
If this is ultimately going to be used by other people, I'd put all the relevant code in the workbook it relates to.

i would in the end replace the active sheet in the XLSB with an actual file path to a different workbook so that i'm not updating the dictionaries on every file i have to open like i currently am.
otherwise i wouldnt really need this method. so like a:

Workbook1.XLSM
Dictionary.XLSX
Personal.XLSB

I open Workbook1, it grabs the info from Dictionary.XLSX and creates dictionaries from respective sheets.
Then i can run various codes using those dictionaries as complicated array matches/lookups/counts/etc
and sharing with other users is going to be via shared folder/drive so the directory and actual file will be the same
 
Last edited:
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
using the code from post #7 and adding a reference to the XLSB VBAProject (which i've named Dictionaries) it works perfectly
same thing if i pass my dictionary object using a public property in the ThisWorkbook module of the XLSB

I couldn't be more elated about this working.
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,209
Members
453,023
Latest member
alabaz

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