title: Excel VBA - Copying specific columns from one worksheet to another worksheet
body: <p>This is the code that I have, but something seems to be incorrect,
  Only the first row of data seems to pop up in the second worksheet.</p>
  <pre><code>Sub copycolumns()
      Dim lastrow As Long, erow As Long
      lastrow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
  
      For i = 2 To lastrow
          Sheet1.Cells(i, 3).Copy
          erow = Sheet2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
          Sheet1.Paste Destination:=Worksheets(“Sheet2”).Cells(erow, 1)
  
          Sheet1.Cells(i, 4).Copy
          Sheet1.Paste Destination:=Worksheets(“Sheet2”).Cells(erow, 2)
  
          Sheet1.Cells(i, 6).Copy
          Sheet1.Paste Destination:=Worksheets(“Sheet2”).Cells(erow, 3)
      Next i
  
      Application.CutCopyMode = False
      Sheet2.Columns().AutoFit
  End Sub
  </code></pre>
  <p>Editing my previous code.</p>
  <p>I found a code more efficient than my previous code,</p>
  <pre><code>Sub CopyPastingColumns()
  
      Dim erow As Long
  
      Worksheets(&quot;Sheet1&quot;).Select
  
      erow = ActiveSheet.Cells(1, 1).CurrentRegion.Rows.Count + 1
  
      Worksheets(&quot;Sheet1&quot;).Select
      Worksheets(&quot;Sheet1&quot;).Range(&quot;D6&quot;).Select
      
      Range(Selection, Selection.End(xlDown)).Select
      Selection.Copy Sheets(&quot;Sheet2&quot;).Cells(erow, 1)
  
      erow = ActiveSheet.Cells(1, 1).CurrentRegion.Rows.Count + 1
  
      Worksheets(&quot;Sheet1&quot;).Select
      Worksheets(&quot;Sheet1&quot;).Range(&quot;I6&quot;).Select
      
      Range(Selection, Selection.End(xlDown)).Select
      Selection.Copy Sheets(&quot;Sheet2&quot;).Cells(erow, 2)
  
  End Sub
  </code></pre>
  <hr />
  <p>How to concatenate two rows from sheet 1 and paste it in any column in Sheet 2?</p>
  <p>For example, both the columns are numbers,</p>
  <p>In Sheet1,
  column A has 123456, column B has 1</p>
  <p>I want output on Sheet2 column C as 1234561</p>