Convert text into certain numbers

oOpsy

New Member
Joined
Nov 27, 2005
Messages
21
Hi there,

I'm currently working on a project .I will like to know if it is possibe to actually convert text into certain numbers? An example will be if user select ' system 1', upon clicking the macro button to update sheet2 with the information, it will display '101' in sheet2. Meaning i can define the text to convert into certain numerals.

like system 1 (in sheet 1) will become 200(set by me) in sheet 2 using vba.

Thanks in advance!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi - welcome to the board!

Yes - things like that are possible, though to say anything more specific, you'll need to give us a more detailed example.
 
Upvote 0
Hi~~

Hope i can explain this properly:

settings.xls is meant for users to select their options. etc column 1 is to select either voltage, current, frequency or resistance. Upon finishing the selection, users should click on the macro button embedded on the sheet to update another wksheet, config.xls.

However instead of display 'voltage' in congfig.xls, i will like to display the assigned code (let say 101) to it. Need help on how to tell excel that voltage = 101, current = 102 etc.


Thanks a million!
 
Upvote 0
you don't need a macro to do that sort of thing. I'd do it like this:

1) Set up a source table that includes the allowable entries (voltage etc) in one column and their associated valies (101 etc)

2) Set up the data entry using data validation (check it out in the help files) to ensure only legitimate values are entered

3) use a vlookup() formula to return the codes for the entries - again, review excel help file for vlookup(), and search the board for examples of its use, including:

http://www.mrexcel.com/board2/viewtopic.php?t=62709

...post back if yo can't get it sorted - but this time include the details of what ranges your data occupies etc.

an example follows:
Book1
ABCDEF
1SourceReturnCategoryValue
2Voltage101Voltage101
3Current102Current102
4Current102Frequency103
5Frequency103Resistance104
6Resistance104
7Voltage101
8
Sheet1


formula is:

=VLOOKUP(A2,$D$2:$E$5,2,0)
 
Upvote 0

Forum statistics

Threads
1,214,657
Messages
6,120,769
Members
448,991
Latest member
Hanakoro

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