Copy Paste Dynamic Range
Hi, I am trying to set the values of one dynamic range to another but I keep getting a run-time error. Here is the code:
Private Sub CommandButton1_Click()
Dim intCollectionsLastRow As Integer
Dim intLastCollectionCopyRow As Integer
intCollectionsLastRow = 10 'FindRow(Sheet17, 10)
intLastCollectionCopyRow = 11 'FindRow(Sheet16, 10) - 1
Dim rngSource As Range
Dim rngDest As Range
Dim strOne As String
Dim strTwo As String
strOne = "B10:N" + CStr(intLastCollectionCopyRow)
strTwo = "B" + CStr(intCollectionsLastRow) + ":N" + CStr
(intCollectionsLastRow - 10)
Set rngSource = Range("strTwo")
Sheet17.Range(rngSource).Value = Sheet16.Range("strOne").Value
End Sub
Can anybody tell me what I am doing wrong? I need to copy only values.
|