Method Range - VBA - Excel
Hello everyone, I hope someone here can help me, I wrote this for an excel report, but I am getting a runtime error "1004" "Method 'Range' of object 'Worksheet' failed" whatever that means! The debugger points to the line I have put in bold. But I can't figure out why it would point out that since I have already used a similiar line.
Public Sub TheBigKahuna()
Dim Row1 As Integer, Row2 As Integer, Col1 As Integer, Col2 As Integer, Count As Integer
Col1 = 1
Col2 = 1
Row2 = 2
For Row1 = 2 To 9594
Sheet2.Range("A" & Row2, "Q" & Row2).Value = Sheet1.Range("A" & Row1, "Q" & Row1).Value
Col1 = 18
Col2 = Col1 + 14
For Count = 1 To 4
Sheet2.Range(Chr(Col1 + 97) & Row2, Chr(Col2 + 97) & Row2).Value = Sheet1.Range(Chr(Col1 + 97) & Row1, Chr(Col2 + 97) & Row1).Value
Col1 = Col1 + 14
Col2 = Col2 + 14
Row2 = Row2 + 1
Next Count
Col1 = 1
Col2 = 1
Next Row1
MsgBox "Complete", vbOKOnly, "Report"
End Sub
Everytime you click start a penguin dies!
|