![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Location: Home
Posts: 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! |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: Redmond, WA
Posts: 636
|
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)" |
|
|
|
|
|
#3 |
|
New Member
Join Date: May 2002
Location: Home
Posts: 6
|
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? |
|
|
|
|
|
#4 | |
|
New Member
Join Date: Apr 2002
Posts: 48
|
Quote:
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 ] |
|
|
|
|
|
|
#5 |
|
New Member
Join Date: May 2002
Location: Home
Posts: 6
|
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!
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|