Drop down list with corresponding value within the same cell.

GravityDead

New Member
Joined
Oct 5, 2017
Messages
17
Hello guys!
Need some quick help here. I want to make a drop down list which shows data from "Column A" when selecting but enter the corresponding value from "Column B" when selected. I hope I made myself clear :)

For example, this is "sheet2"
Column A - Column B
1947 - 500
1948 - 1000
1949 - 2000
1950 - 1500

I want to make a drop down in another sheet, say "sheet1", in cell K2 and all the cells down below.
When I click on K2, the drop down list should show the options, "1947", "1948", "1949", "1950" BUT when I select any of these values from Columns A in K2, the K2 cell should be filled with corresponding value from Column B.

Is it possible to do so or I HAVE to do it indirectly?

Regards.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hello again mumps. thank you for your help so far man :D

Would it be possible to add a similar VBA to another column in the same sheet (first sheet)?
but this time data validation source will be from another sheet!
 
Upvote 0
Another update, I even managed to do merge two Private Sub Worksheet_Change VBAs in one sheet after some more googling :D :)

Here is the final code that I'm using for future references
Private Sub Worksheet_Change(ByVal Target As Range)
My_Sub_A Target
My_Sub_B Target
End Sub
Public Sub My_Sub_A(ByVal Target As Range)
If Intersect(Target, Range("K:L")) Is Nothing Then Exit Sub
If Target = "" Then Exit Sub
Dim val As Range
Target.NumberFormat = ChrW$(&H20B9&) & "##,##0"
Set val = Sheets("AdvanceNotes").Range("A:A").Find(Target, LookIn:=xlValues, lookat:=xlWhole)
If Not val Is Nothing Then
Target = val.Offset(0, 1)
End If
End Sub
Public Sub My_Sub_B(ByVal Target As Range)
If Intersect(Target, Range("J:J")) Is Nothing Then Exit Sub
If Target = "" Then Exit Sub
Dim val As Range
Target.NumberFormat = ChrW$(&H20B9&) & "##,##0"
Set val = Sheets("CreditTracking").Range("B:B").Find(Target, LookIn:=xlValues, lookat:=xlWhole)
If Not val Is Nothing Then
Target = val.Offset(0, 1)
End If
End Sub

mumps FTW :D

regards
GravityDead

UPDATE for moderators: forgive me for multiple replies, I didn't notice that I had the option of editing a post.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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