I want to get automatic value in excel VBA in case I type AOM letter in cell, it will shows automatic data 1. if it is BOM letter, it will shows 2. if it is COM letter, it will shows 3.
In example, AOM=1,BOM=2,COM=3
How to write excel vba code to change automatic value in excel cell as condition above.
Regards,
NON VBA SOLUTION
As mentioned in the comment above, Why not a simple
Excel Formula
? If you want to update the same cell then why not aData Validation List
or sayAutoCorrect
?Not sure if you are aware of the
AutoCorrect
Option in Excel. You can use theAutoCorrect
feature to correct typos and misspelled words, as well as to insert symbols and other pieces of text. We will use this feature to do what you want... i.e replaceAOM
by1
,BOM
by2
,COM
by3
.Do This
File
tab |Options
.Excel Options
dialog Box, Click onProofing
.AutoCorrect
tab, make sure theReplace text as you type
check box is selected.Replace
box, type aAOM
With
box, type1
Add
.BOM
andCOM
OK
and you are done :)This maybe?
Put code in any
Sheet Object
.Hope this gets you started.