Excel Help

Status
Not open for further replies.

MrBlack

Ars Tribunus Angusticlavius
9,266
Subscriptor
Hey all, I hope this is the right forum to put this in. I have a list of people who are coded (i.e. John Smith is A1JS, Fred Smith is A1FS, etc) and when those codes are being input in a column I'd like it to auto populate with the full name. So, if someone is typing A1JS I'd like it to auto change to John Smith.

I rarely, if ever, use excel but I'm trying now. This would be a find and replace sort of functionality but I'd like to do it on the fly. Any thoughts? Also, what's a good place to start learning this stuff. I used to be able to program in Excel but that was over a decade ago...
 

topham

Ars Legatus Legionis
13,756
Subscriptor
Accept the data as-is; show the name via VLOOKUP in another cell.

So, if the user is entering data in cell A1, display the VLOOKUP result in B1. You can use a more complicated formula in B1 to display the value from A1 if the lookup fails, or the value from the lookup if it doesn't.

If you substitute data (via copy, or otherwise) into a cell you're just looking for a heap of issues down the road.
 

topham

Ars Legatus Legionis
13,756
Subscriptor
Blacken00100":27mn6so5 said:
VLOOKUP will only work if the token is alone in its column, won't it? I took the question to mean a replace of "A1JS" wherever it was, but if it's the only data in its cell, that should work easily. Is that acceptable for your use case?

If it's mixed data in the cell you'd have to extract it before using it as a parameter, still possible but the macro would be hideous.
I took the problem as expressed to just being a code entered in a field, and wanting to display the full name instead. Entering timesheets with employee IDs instead of name, but showing the names for visibility. It's a pretty simple, and pretty standard, thing to do in Excel.

I'd rant about Excel not being a database, etc, etc, but it's actually half decent for such working loads on a small scale.
 

MrBlack

Ars Tribunus Angusticlavius
9,266
Subscriptor
I shoehorned VLOOKUP to work in this case. I created a table with the codes A1JS and the corresponding name. Entered data in A1 and had the VLOOKUP in B1. It worked well enough. It's not a huge table of information but it will be repeated weekly so it's nice to just be able to fill in the code and have it autopopulate with actual names.

I wish my company let me create macros in host explorer though so I could scrape all the data we need from the fields and have it input in excel. Instead of spending half an hour a day I could spend about 10 seconds. :)
 
Status
Not open for further replies.