Sourav Mukherjee

New Member
Joined
Jun 23, 2015
Messages
7
Dear All,

There are two column mentioned below

Animal NameAnimal Type

<tbody>
</tbody>

In the column named "Animal Name" there is data validation of all Animal like
Goat
Cow
Horse
Lion
Tiger
Fox

<tbody>
</tbody>

<tbody>
</tbody>
There are two other column
Types OF Animal
VegiterianNon Vegiterian
GoatLion
CowTiger
HorseFox

<tbody>
</tbody>

Now My concern is whenever I select an animal name from the list in the "Animal Name" tab in the next cell It need to show the animal type like this.

Animal NameAnimal Type
GoatVegiterian
LionNon Vegiterian

<tbody>
</tbody>





Thanks
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Just to clarify ... Is the drop down list (validation) on one sheet and the animal types on a different sheet? If so, in which cell is the drop down list and in which columns are the animal types?
 
Upvote 0
Just to clarify ... Is the drop down list (validation) on one sheet and the animal types on a different sheet? If so, in which cell is the drop down list and in which columns are the animal types?

Thank You for you reply

(Sheet 2)
Hear we have the original list of all animal which is validated on Sheet 1 and the "Types Of animal",

(Sheet 1)
"Animal Name" is located on "A3" cell this is a drop-down list(Data Validation) when ever we select a animal from this list It Need to show the "Animal Type" in "B3" cell.
 
Upvote 0
Copy and paste this macro into the worksheet code module. Do the following: right click the tab for your Sheet1 and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Make your selection in cell A3. I'm assuming that the "Types Of animal" are in columns A and B of Sheet2.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("A3")) Is Nothing Then Exit Sub
    Application.ScreenUpdating = False
    Dim foundVal As Range
    Set foundVal = Sheets("Sheet2").Range("A:A,B:B").Find(Target, LookIn:=xlValues, lookat:=xlWhole)
    If Not foundVal Is Nothing Then
        Range("B3") = Sheets("Sheet2").Cells(1, foundVal.Column)
    Else
        MsgBox ("Animal not found.")
    End If
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,100
Messages
6,128,834
Members
449,471
Latest member
lachbee

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