Excel VBA/formula direction

eviljamk55

New Member
Joined
May 1, 2002
Messages
6
Hi all:

Thanks for all the great tips. I did not have any luck with the search feature so I thought I would post my question:

I need to have a macro (or formula) that will change an entered value to a value found in a table (or listed in the macro).

Example:

User puts types '1024' into a cell, and when the user changes cells (completes the entry), it is changed to 'ABCD'

Please let me know if I can provide any better detail.

Thanks!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Let's say they enter that into cell A1 and the table is on the same page in B1:C10.

B1 = 1024
C1 = ABCD

I don't know what kind of event you want to trigger this, but try this:

range("b1").formula = "=vlookup(" & range("b1").value & ", B1:C10, 2,0)"
 
Upvote 0
Awesome, Thanks for the Help! Your great. Just that helps me a lot!

however, I another twist if I may:

how can I do the same thing but have the list(table) defined within the macro?
 
Upvote 0
On 2002-05-02 14:45, eviljamk55 wrote:
Awesome, Thanks for the Help! Your great. Just that helps me a lot!

however, I another twist if I may:

how can I do the same thing but have the list(table) defined within the macro?

How about using something like:

Select Case Range("A1").Formula
Case "1024"
Range("A1").Formula= "ABCD"
Case "1025"
Range("A1").Formula = "EFGH"
Case Else
End Select
This message was edited by MT_Shanachie on 2002-05-02 15:05
This message was edited by MT_Shanachie on 2002-05-02 15:36
This message was edited by MT_Shanachie on 2002-05-02 15:37
 
Upvote 0
Thank you. I have not had a chance to try it, but I am sure it is better than what I have. Once Again, Thank you!
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,140
Members
448,551
Latest member
Sienna de Souza

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