CASE SELECT, or IF-THEN vba question

Favorite_Headache

New Member
Joined
Jun 9, 2014
Messages
2
Dear Excel vba gurus,
A question about filling in a range for a vba newbie:
In column A of my sheet 1, I have a listing of 9000+ items, but
all of these are text, with no values. Also, all of these are
being drawn from a pool of around 300 unique items. I have
numbers that corresponds to each of the group of 300 that I want
to put into column J that corresponds to the column A text value.
For example, this is what I would like column J to look like when
I'm done:
Col-A Col-J
Open 3
Open 3
Open 3
Closed 1
Closed 1
New 4
New 4
Old 5
Old 5
I tried to do this with an IF formula at first, but that wouldn't
work for me, since I am dealing with 300 different IF statements. I'm sure that there is some way to use CASE SELECT to
accomplish this, but I'm not sure how to pull it together.
Thanks in advance for the help!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi!

Welcome to the board.

I would put all of the possible unique items on another sheet, and then use VLOOKUP to get those data in to your main data sheet.

Excel 2010
ABCDE
1YOUR DATALOOKUP TABLE
2Open3Open3
3Open3Closed1
4Open3New4
5Closed1Old5
6Closed1
7New4
8New4
9Old5
10Old5

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
B2=VLOOKUP(A2, $D$2:$E$5, 2, FALSE)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



You can find VLOOKUP in the Excel help file but shout if you need more assistance.

/AJ
 
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,795
Members
449,468
Latest member
AGreen17

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