title: copy paste range in first empty column in excel vba
body: <p>I want to copy the range of cells (C1:Z1000) of worksheet3 and paste them to the first empty column of worksheet1 (in row 1). The code below blocks at the last line: source.Range("C1:Z1000").Copy destination.Cells(1, emptyColumn)</p>
  
  <pre><code>Sub CopyRange()
  
  Dim source As Worksheet
  Dim destination As Worksheet
  Dim emptyColumn As Long
  
  Set source = Sheets("Sheet3")
  Set destination = Sheets("Sheet1")
  
  'find empty Column (actually cell in Row 1)'
  emptyColumn = destination.Cells(1, destination.Columns.Count).End(xlUp).Column
  If emptyColumn &gt; 1 Then
  emptyColumn = emptyColumn + 1
  End If
  
  source.Range("C1:Z1000").Copy destination.Cells(1, emptyColumn)
  
  End Sub
  </code></pre>