![]() |
#1
|
|||
|
|||
![]() I have a list of Item_Code and its Item_Name in Sheet2 of columns A and B. I want that when I enter Item_Code at B2 cell in Sheet1 and then press ENTER. Then Item_Code is replaced by corresponding Item_Name in Sheet1. How can I achieve this. |
#2
|
|||
|
|||
![]()
Have you tried using VLOOKUP?
![]() |
#3
|
||||
|
||||
![]()
If you want to replace the value of a cell with another VBA is required. I will move your thread there
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#4
|
|||
|
|||
![]()
Why not to enter item code into one cell in sheet1, and get proper item name from Sheet2 in adjacent cell? Using VLookup like Bumba did advice! The formula will be something like:
Code:
=VLOOKUP($B2,Sheet2!$A$2:$B$100,2,0) |
#5
|
||||
|
||||
![]()
@Arvi
The OP asked that the existing vale of a cell be replaced by another one. I don't think vlookup will help
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#6
|
|||
|
|||
![]()
If your codes and names are on sheet2 in columns A and B, beginning in row 2:
- Copy the code below. - Rightclick on the sheettab of sheet1 and click "View code". - Where the cursor is flashing, rightclick and choose "Paste". - Now you can drop codes in Sheet1 columnB, beginning in B2. Code:
Private Sub Worksheet_Change(ByVal Target As Range) Dim a As Integer If Not Intersect(Range("b2:b30"), Target) Is Nothing Then a = Application.CountIf(Sheets(2).Range("a2:a30"), Target) If a > 0 Then Target.Value = Application.VLookup(Target, Sheets(2).Range("a2:b30"), 2, 0) End If End If End Sub Last edited by alpha; 01-21-2019 at 12:37 AM. |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Formula to enter value based on value of another cell | onemorething | Excel | 3 | 12-06-2017 09:26 AM |
![]() |
MikeWhite | Word | 5 | 01-20-2017 03:39 PM |
Addresses in To... field disappear when pressing send | BigFinger | Outlook | 0 | 02-26-2015 06:01 AM |
default cursor movement after pressing enter, ms office 2013, win 8 | sansousea | Excel | 0 | 07-11-2014 09:46 AM |
how to enter what i want in cell | tasuooooo | Excel | 4 | 07-23-2012 05:45 AM |