title: VBScript To copy the specified column only
body: <p>I wanna copy all the rows of first 4 column from multiple excel sheet of the same workbook to a single sheet of another workbook (With header copied only once).
  Below is the code that I have written to do so, but it is copying the whole range. I am not able to copy the first 4 columns exclusively.
  Please Help.</p>
  
  <pre><code>on error resume next
  set objexcel = createobject ("Excel.Application")
  
  Dim objexcel
  dim objworkbook1, objworkbook2, objworksheet
  dim i,startrow,intnewrow,endrow,countsheet
  dim Firstcell,lastcell
  strpath = "C:\Documents and Settings\SupriyaS\Desktop\Copy of Movement Report"
  
  Set objWorkbook2= objExcel.Workbooks.Add()
  objWorkbook2.SaveAs("C:\Documents and Settings\SupriyaS\Desktop\Master Dump")
  
  set objworkbook1 = objexcel.workbooks.open(strpath)
  
  countSheet = objworkbook1.Sheets.Count
  
  intnewrow=1
  i = 1
  
  for i = 1 to countsheet
  wscript.echo i
  
  Set objWorksheet = objWorkbook1.WorkSheets(i)
  objworksheet.Activate
  
  'copy from the 2nd row 
  If intNewRow = 1 Then
  startrow = 1
  Else
  startrow = 2
  End If
  
  'count the number of used row
  endrow = objWorkbook1.Worksheets(i).UsedRange.Rows.Count
  
  'copy the data
  objWorkbook1.Worksheets(i).Range(startrow &amp;":"&amp; endrow).select
  objexcel.selection.copy
  
  'paste it on workbook2
  objWorkbook2.Worksheets("Sheet1").Cells(intNewRow,1).Pastespecial
  
  'increment the row
  intNewRow = intNewRow + (endrow - startrow + 1)
  
  next
  
  objworkbook1.close
  objworkbook2.save
  objworkbook2.close
  
  msgbox "Done"
  </code></pre>