Results 1 to 4 of 4

Thread: Validation list: selecting a value, display another

  1. #1
    Join Date
    Nov 2008
    Posts
    996

    Validation list: selecting a value, display another

    I want to simplify an attachment, have a validation list like this:

    A | B
    Cost 1 | Rs. 10
    Cost 2 | Rs. 20
    Cost 3 | Rs. 30

    The value in the cell A10, for example, must be validated by list, but I want:
    - Displays the list cost 1/Cost 2/Cost 3
    - Selection of cost 2 place the value Rs. 20 in cell

    Have you any idea how to program this?

  2. #2
    Join Date
    May 2008
    Posts
    271

    Re: Validation list: selecting a value, display another

    Hello,

    I do not think it is possible to define a validation list (Cost X) in a cell and this cell then takes a value (amount) which does not exist in the validation list.

    May be you can:
    Code:
    =RECHERCHEV ( A10;A1:B3; 2 ; 0 )
    but it takes two cells: one for choice and for equivalence in Rs.

    Why not make the list directly to validate the amounts?

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Validation list: selecting a value, display another

    Hello,

    Code:
      On gets the right value 
      Private Sub Worksheet_Change (ByVal Target As Range) 
        If Target. Column = 1 Then 
          Application. EnableEvents = False 
          On Error Resume Next 
          Target = [List]. Find (Target, LookAt: = xlWhole). Offset (, 1) 
          Application. EnableEvents = True 
        End If 
      End Sub

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: Validation list: selecting a value, display another

    Attention that the case is identical in the validation list and the code. The simplest and save the list directly in the source box

    Code:
    Cost 1, Cost 2, Cost 3
    Code:
    Private Sub Worksheet_Change (ByVal Target As Range) 
      If TARGET. Address = Range ( "a1"). Then Address 
      Select Case Target 
      Case "Cost 1" 
      Target = "Rs. 10" 
      Case "Cost 2" 
      Target = "Rs. 20" 
      Case "Cost 3" 
      Target = "Rs. 30" 
      End Select 
      End If 
      End Sub
    Attention has also disable alerts for cases of bad entries in the validation data

Similar Threads

  1. Replies: 2
    Last Post: 23-02-2012, 11:54 AM
  2. How to use table column as data validation list
    By connoisseur in forum MS Office Support
    Replies: 2
    Last Post: 13-01-2012, 06:10 PM
  3. Ghostery 0.9.1 ext does not display the list of bugs in Opera 12
    By bIbEkS in forum Technology & Internet
    Replies: 5
    Last Post: 13-11-2011, 08:26 PM
  4. Replies: 4
    Last Post: 06-08-2010, 05:27 PM
  5. Thunderbird : display of attachments in list form
    By Beter 2 Burn Out in forum Technology & Internet
    Replies: 4
    Last Post: 30-03-2009, 03:40 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,720,017.82971 seconds with 16 queries