Number to equal cell value

tremalking

New Member
Joined
Jan 23, 2014
Messages
3
Hi all,
I currently, manually create my production work orders using excel (in-house ERP system not good enough).
Rather than manually type in the names of products to be produced, I would like to have the number 1 = a production item and 2 = another and so on.....
So basically when I type 1 in a cell it will automatically display a production item.

I imagine this to be a process where i would type all the names of my production items in individual cells, then create a formula to make 1 = a specific cell, 2, 3, 4, etc.....

Is this possible?

Your help is appreciated.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Given a Sheet1 looking like this:

Excel 2010
ABCDEFG
1
2<< Enter your Number Here1Peter
32Paul
43Mary

<tbody>
</tbody>
Sheet1



Paste this code into your worksheet's code module
Then enter either 1, 2 or 3 into Cell B2

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$B$2" Then Exit Sub
On Error Resume Next
Application.EnableEvents = False
Target = WorksheetFunction.VLookup(Target.Value, Range("$F$2:$G$4"), 2, False)
Application.EnableEvents = True
On Error GoTo 0
End Sub
 
Last edited:
Upvote 0
Hi Jim,
I cant seem to get this to work.
I have changed the cell ranges to suite my worksheet, but every time I enter a number in the cell only the number appears.
I really am a noob when it comes to Macros.
 
Upvote 0
What is the Name of the Sheet your data is on? I assumed Sheet1

From the Sheet do an ALT+F11 to get to the VBE,
There in the left pane make sure your Sheet1 is highlighted -- then in the Code widow to the right - Paste in the entire block of Code!!

Return to the Spreadsheet and in cell b2 begin entering 1, 2, or 3
 
Upvote 0
Thanks very much for that Jim.
The reason I couldn't get it to work on other consecutive cells was the <> symbols on the second line rather than =
All sorted, I can now play about with this now.
Fantastic stuff!!
Again, a big THANKS!! Very much appreciated. :)
 
Upvote 0

Forum statistics

Threads
1,214,942
Messages
6,122,366
Members
449,080
Latest member
Armadillos

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