title: Extracting data with userform
body: <p>I am trying to extract data using a userform.</p>
  
  <p>Here is the structure of Excel columns:</p>
  
  <pre><code>sheet1:  
  column 1|column 2|column 3|column 4|column 5  
  Sheet2:  
  column 1|column 2| ......................................... column xx  
  </code></pre>
  
  <p>The column 1s are same in both sheets. I want a dropdown to select any value from column 1 and these fields should be displayed in a userform based on the selected value of column 1.</p>
  
  <p>column 1|column 2 of sheet1|column 2 ------ column xx of sheet 2| column 3, 4, 5 of sheet 1  </p>
  
  <p>Here is the code I created but it is unable to pick required data</p>
  
  <pre><code>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
  </code></pre>