Results 1 to 8 of 8

Combine and show two list in data validation with if condition

Threaded View

  1. #1
    Registered User
    Join Date
    02-24-2020
    Location
    India
    MS-Off Ver
    2010
    Posts
    23

    Combine and show two list in data validation with if condition

    HI,
    1. I have a list of "products", "raw materials", "packing materials" each in different sheets
    2. and in another i have data validation to show this list with respective to the value in near by cell as "SALE", "PRODUCTS","MANUFACTURING", "PURCHASE"

    Now,

    1. if the cell has value "SALE" or "PRODUCTS" I want to get the list of "PRODUCTS"
    2. If the cell has value "Purchase" or "Manufacturing" i want to show both list "RAW MATERIAL" AND "PACKING MATERIAL"

    I found a VBA code mentioned below to do this ,

    Option Explicit
    
    Sub Validation_two_ranges()
        Dim a$, el As Range
        Dim rng1 As Range, rng2 As Range
            Set rng1 = Range("c3:c5") 'you can assign by namerange
            Set rng2 = Range("d3:d5")
        For Each el In rng1 'first range
            a = a & el.Value & ","
        Next
        For Each el In rng2 '2nd
            a = a & el.Value & ","
        Next
        With Range("A1").Validation 'destination val.list
            .Delete
            .Add Type:=xlValidateList, Formula1:=a
        End With
            Set rng1 = Nothing
            Set rng2 = Nothing
    End Sub.
    Now..how do i write formula in data validation for this to work.
    Last edited by arunvijilan; 03-02-2020 at 04:14 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Data validation list with date condition
    By benlw1984 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-02-2020, 03:39 PM
  2. Combine two data validation functions - 'List' & 'Custom'
    By STUARTXL in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-25-2018, 08:52 AM
  3. Always Show drop down list Of Data Validation List
    By dorothyredsh0es in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-26-2018, 12:40 AM
  4. Data Validation combine 2 dynamic list with an IF statement
    By jwan544 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-14-2018, 04:24 PM
  5. [SOLVED] Combine two data validation list and formula in the same cell?
    By Hellion in forum Excel General
    Replies: 1
    Last Post: 08-09-2016, 01:49 PM
  6. [SOLVED] Combine Data Validation list, vlookup and Omit Characters
    By Hilkiah in forum Excel General
    Replies: 7
    Last Post: 08-31-2015, 11:28 AM
  7. Data Validation list with condition
    By vascobmcastro in forum Excel General
    Replies: 21
    Last Post: 08-16-2010, 12:18 PM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1