Data Validation - Dependent List

P

Prasad Gopinath

I have a spreadsheet where I need to set up Data Validation for a Dependent
list.

Sheet 1 - Validation List
Column A - Service
Column B - Price

Cell A1 value - Super NYC Show
Cell B1 value - $ 75

Is there any way I can set up Data Validation in Sheet 2 where if I selected
Selected Super NYC Show in Sheet 2, it will automatically pull up the
corresponding $ 75 value in the adjacent cell of the said spread sheet?

Prasad
 
R

RyanH

I would use the double click event in the Worksheet 2 Module. The code below
assumes the cells you will be clicking on is in Col.A. All you have to do is
double click the cell and the code will execute to what you want.

Option Explicit

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

Dim Service As Range

If Target.Column = 1 Then

'prevents default action
Cancel = True

'sets range and enters value from sheet1
Set Service = Sheets("Sheet1").Range("A:A").Find(What:=Target,
LookIn:=xlValues)
Target.Offset(0, 1).Value = Service.Offset(0, 1).Value

End If

End Sub

Hope this helps! If so click "Yes" below.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top