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

  • SEARCH
  • Home
  • 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 4612216
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:22:25+00:00 2026-05-22T01:22:25+00:00

I have data in 2 sheets excel say sheet2 and sheet3 and values in

  • 0

I have data in 2 sheets excel say sheet2 and sheet3 and values in column1 of both sheets is same. So i created a userform with 1 dropdown(Combobox1), 4 textbox field and 1 listbox field.

dropdown picks data from column 1(ex. A2:20) of sheet2 and then once a value is selected it should display corresponding row values in textbox respectively
for example:
from sheet2 corresponding col-2 should be displayed in textbox1, col-3 in textbox2, col4 in textbox3, col5 in textbox4.
while from sheet3 it should match the row where column1 value matched the selected value from from dropdown(combobox) and all corresponding values(in Col 2 – Col52) should be displayed in userform ListBox1.
I am new to vba and excel so with help of google finally i was able to perform some of above mentioned tasks but i am not getting any head and tail how to connect selected range values to textbox’es and listbox.
Any help will be highly appreciated and will be a good learning lesson for me.
here’s the half and not working code i created.

Private Sub ComboBox1_Change()

Application.ScreenUpdating = False


Dim CL As Object

Worksheets(2).Select

For Each CL In Worksheets(2).Range("A2:A20")
If CL = ComboBox1.Text Then
Range(ActiveCell, ActiveCell.Offset(0, 4)).Copy Destination:=ActiveCell.Offset(0, 5)

End If
Next
Worksheets(2).Select
End Sub



Private Sub UserForm_Activate()
ComboBox1.RowSource = "A2:A20"
End Sub
  • 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-22T01:22:25+00:00Added an answer on May 22, 2026 at 1:22 am

    This may get you on the right track:

    Private Sub ComboBox1_Change()
        Dim rw As Long, cl As Range
    
        rw = WorksheetFunction.Match(Me.ComboBox1.Value, Worksheets("Sheet2").Range("A1:A20"), 0)
        TextBox1 = Worksheets("Sheet2").Range("A" & rw).Offset(0, 1)
        TextBox2 = Worksheets("Sheet2").Range("A" & rw).Offset(0, 2)
        TextBox3 = Worksheets("Sheet2").Range("A" & rw).Offset(0, 3)
        TextBox4 = Worksheets("Sheet2").Range("A" & rw).Offset(0, 4)
    
        ListBox1.Clear
    
        For Each cl In Worksheets("Sheet3").Range("B" & rw & ":AZ" & rw) //Here AZ is column 52 in worksheet
            ListBox1.AddItem cl
        Next cl
    End Sub
    
    Private Sub UserForm_Activate()
        ComboBox1.RowSource = "A1:A20"
    End Sub
    

    Update

    If you want the ListBox to show data horizontally then:

    1. In ListBox properties set ColumnHeads to True
    2. In ListBox properties set ColumnCount equel to 52

    Now replace For each cl... code aboe with:

    Dim rng As Range
    Set rng = Worksheets("Sheet3").Range("B" & rw & ":AZ" & rw)
    Me.ListBox1.RowSource = rng.Address
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one Excel document with two sheets Sheet1 and Sheet2. Sheet1 data is
I have an excel document with multiple sheets. Each sheet contains data of separate
I have an Excel document with 10000 rows of data in two sheets, the
i have 500 excel sheets which are used for data collection from various organisations
For the sake of this question, let's say I have an Excel data source
i have two sheets having data like this sheet1 : **A** **B** **C** 752
Lets say I have an Excel file named DataSheet.xls open. How can I kill
I have an asp.net website that will generate some excel files with 7-8 sheets
I have code that imports from Excel sheets of a specified format. In one
I have a few hundred Excel files, where each file has some data on

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.