Excel is hard... I tell you hwhat!

RoyalRife

New Member
Joined
Mar 26, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I have a condition in an Excel table I cannot solve, and I need some help. I'm an Excel newb, so my first reaction was to go down the YouTube rabbit hole. Obviously, that was not fruitful and left me more confused. My issue is as follows:

While at work, every morning, I have to copy and paste a table of data into a blank Excel sheet from a program my employer uses. It must be done every day because the data values in the table update and change, from the previous day. Then I format the table with a few macros to make the table look a certain way. No issue so far. The last task I need to perform has stumped me. There is a column in the table that display employee numbers in every cell. Each employee number corresponds to a specific employee's name in our company. I need the employees name displayed in the cell, not the number. After I copy and paste the table in Excel, is there a format to accomplish this change? In total, there are ten numbers that correspond to ten employee names.

Question: How do I make the cells in column B display the employee's name, in place of the employee's number, in that cell every time that number occurs in the B column?

Example: If the number 47 occurs in any cell in column B, then the name that corresponds to number 47 should replace 47 and display that name in the same cell. This should happen in any cell in column B that contains the number 47. Which is the name Eddie, in this case. The same applies to employee numbers 15, 23, and 31 in column B, with their corresponding employee names.

Example list:
15=Bob
23=Jim
31=Dan
47=Eddie
Etc...

I hope that explanation is logical. Thank you in advance for any help.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Maybe...
VBA Code:
Sub replaceit()
    With Range("B2:B" & Range("B" & Rows.Count).End(xlUp).Row)
        .Replace "15", "Bob", xlWhole
        .Replace "23", "Jim", xlWhole
        .Replace "31", "Dan", xlWhole
        .Replace "47", "Eddie", xlWhole
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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