Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 524367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:33:38+00:00 2026-05-13T08:33:38+00:00

im interested to implement something but im not sure if it would be possible

  • 0

im interested to implement something but im not sure if it would be possible and would like your intake on it.

here is my scenario:

i will have two validation cells which will be shown as List that I will pick from.
those are my condition that i would like to meet and ommit my list from a database.

I have a list of agents going threw B13:B23 and next two them i have columns of data
assuming that my data base looks like this

 B     C      D     E
       X  |   Y  |  Z
agent1 1  |   1  |  0
agent2 0  |   1  |  0
agent3 0  |   1  |  1
agent4 1  |   0  |  0

…

i want to populate a list of agent name from column B, when i select from the validation cell1: X and validation cell2: 1.
it should show only

column:
agent1
agent4

or agents in column X with 0…

i read somewhere about array formula but i dont know if this is convenient and i unfortunately dont have any background in macros:( but i know in C++ something like this is fairly easy with conditional statements.

thanks in advance,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:33:39+00:00Added an answer on May 13, 2026 at 8:33 am

    It is possible. One way to approach this is to call a sub that lists you the relevant agents whenever the Target in your Worksheet_Change intersects with validation cell1 or cell2 -> the validation changed.

    Then you would run a sub with 3 paramenters srcRange, validationColumn and validationValue that goes throgh each row of srcRange and checks if the cell on position rownumber, validationColumn is equal to validationValue if so it outputs the agent and sets outputrow + 1

    Put this VBA in your Sheet:

    Option Explicit
    
        Private Sub Worksheet_Change(ByVal Target As Range)
            Dim watchRange As Range
            Dim validationValue As Range
            Dim validationColumn As Integer
            Set watchRange = Me.Range("H1, I1") ' Validation Cells '
    
            If Not Intersect(Target, watchRange) Is Nothing Then
                Set validationValue = Me.Range("I1")
                validationColumn = 0
                With Me.Range("H1")
                    If (.value = "X") Then validationColumn = 2
                    If (.value = "Y") Then validationColumn = 3
                    If (.value = "Z") Then validationColumn = 4
                End With
                    listAgents Me.Range("B3:E6"), validationColumn, validationValue
            End If
    
        End Sub
    
        Private Sub listAgents(ByRef srcRange As Range, ByVal validationColumn As Integer, ByRef validationValue As Range)
    
            Dim outputStart As Range
            Dim row As Range
            Dim i As Long
    
            Set outputStart = Me.Range("H3")
            outputStart.CurrentRegion.Clear
    
            If validationColumn = 0 Then
                MsgBox "Can't find Validation Column"
                Exit Sub
            End If
    
            i = 0
            For Each row In srcRange.Rows
                If (row.Cells(1, validationColumn) = validationValue) Then
                    outputStart(1 + i, 1) = row.Cells(1, 1)
                    i = i + 1
                End If
            Next row
        End Sub
    

    I tested it on your example and it worked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 357k
  • Answers 357k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The other answers are correct. Here is some code you… May 14, 2026 at 9:40 am
  • Editorial Team
    Editorial Team added an answer you ruin the noConflict concept by reassigning the jquery to… May 14, 2026 at 9:40 am
  • Editorial Team
    Editorial Team added an answer If you get that particular error, you don't actually have… May 14, 2026 at 9:40 am

Related Questions

No related questions found

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.