Scripting dictionary name replacer

Luke777

Board Regular
Joined
Aug 10, 2020
Messages
246
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm sure I asked a similar question a couple of years ago, but I don't seem to be able to find the post.

Basically, on Sheet1 I have product names in column B. On sheet 2, I have the same product names in Column A and product codes in B. I would like to replace the names on Sheet 1 with product codes. I've already handled errors before this stage (name on Sheet1 with no reference on sheet2, prompting user intervention).

I'm sure this is doable by chucking the 'index' (sheet2) in a dictionary and then going through Sheet 1 A, but it's a bit beyond my ability to recall the method

Thanks
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Can't you just use a formula (XLOOKUP) to pull the product codes into Sheet1 and then copy/paste Values them on top of those names?
 
Upvote 0
Can't you just use a formula (XLOOKUP) to pull the product codes into Sheet1 and then copy/paste Values them on top of those names?
I could do, but this is taking place in the middle of a load of other code that cleans and transforms the data at the press of a button - I'd sooner keep it all within VBA... though I guess I could use VBA to handle the formula?
 
Upvote 0

Forum statistics

Threads
1,215,077
Messages
6,122,992
Members
449,094
Latest member
masterms

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