Data Validation Input Message = formula?

nathee021

New Member
Joined
Sep 7, 2018
Messages
3
Is there any way to use a formula for the input message when using data validation? Here is what I am trying to accomplish:

User clicks drop down and selects a cost code from list. When they select the cost code, there is a temporary window next to it that shows the description of the cost code, so they can be sure they are selecting the correct code.

If input message in data validation is not the correct way to go about accomplishing this, any suggestions?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Why not simply use 2 columns?
- column A = description (contains dropdown)
- column B = account no (contains formula)
- user selects from dropdown is in column A and lookup formula in column B returns the correct acccount number
 
Upvote 0
There are lots of ways of using VBA - here is one suggestion to whet your appetitie

Quickly test method as follows:

- create a new workbook with 2 sheets (Sheet1 and Sheet2)

In Sheet2
- paste values below into cells A1 to B3
100004Cars
100005Vans
100006Bikes

<tbody>
</tbody>

- paste formula =A1&" "&B1 into C1 and copy down to C2 & C3
- select C1:C3
- name that range MyList
(by typing MyList into the Name Box (the box above cell A1) and ENTER )

In sheet1
- select cells A2:A10
- on Data tab \ Data Validation \ List \ source =MyList
- right click on sheet tab \ View Code \ paste code below into the code window \ {alt}{F11} to go back to Excel
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Column <> 2 Then End
    Dim cel As Range, rng As Range
    Set rng = Range("A2", Range("A" & Rows.Count).End(xlUp))
        For Each cel In rng
            cel.Value = Left(cel.Value, 6)
        Next cel
End Sub


- select from dropdown in A2
- click on cell B2
- select from dropdown in A3
- click on cell B3
etc
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,510
Members
448,967
Latest member
screechyboy79

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