title: Excel Macro Copy Range Paste offset based on cell value
body: <p>I have two sheets "Data" - which has raw data and "Report" - as Report form . </p>
  
  <ul>
  <li>Report sheet first 5 rows has info.</li>
  <li>Data Sheet there 6 columns of Data available (SlNo Name Desig Place gender Category) </li>
  <li>Report sheet has first 5 columns only (SlNo Name Desig Place gender) </li>
  <li>Report sheet range C5 is dropdown box (List from Category column of Data sheet). </li>
  </ul>
  
  <p>So based on this C5 value get details from Data sheet and paste in Report sheet. </p>
  
  <p>I tried the following code but it pastes the whole row when I want to paste only Name,Desig,Place,gender details in offset and loop...    </p>
  
  <pre><code>Sub ViewBtn()
  Dim SCHL As String
  Dim x As Long
  x = 2
  Do While Cells(x, 1) &lt;&gt; ""
  Sheets("Report").Range(Cells(x, 1).Address, Cells(x, 5).Address).ClearContents
  x = x + 1
  Loop
  Dim id As String
  id = ActiveSheet.Range("C5").Value
  x = 2
  Sheets("Data").Select
  Category = id
  Do While Cells(x, 1) &lt;&gt; ""
  If Cells(x, 4) = Category Then
  Worksheets("Data").Rows(x).Copy
  Worksheets("Report").Activate
  erow = Sheets("Report").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
  ActiveSheet.Paste Destination:=Worksheets("Report").Rows(erow)
    End If
  Worksheets("Data").Activate
   x = x + 1
     Loop
    Application.CutCopyMode = False
   Worksheets("Report").Activate
  
   End Sub
  </code></pre>