Hi everyone,
I'm a notice when it comes to programming. I've been trying to write a macro to have a fixed row in my first file copy to the next open row of my second file. The problem is everytime I run this macro I get a run time error subscript out of range and I don't know why.
'create variable
'strFirstFile = "X:\Resolution\Blue Roof\Emergancy Service Request Form.xls"
'strSecondFile = "X:\Resolution\Blue Roof\Emergancy Service Data gathering form.xls"
'Set wbk = Workbooks("X:\Resolution\Blue Roof\Emergancy Service Request Form.xls")
' Windows(wbk).Activate
' With wbk.Sheets("Sheet3")
' Range("A2:AQ2").Copy
'End With
'Set wbk = Workbooks("X:\Resolution\Blue Roof\Emergancy Service Data gathering form.xls")
' With wbk.Sheets("Sheet1")
' lMaxRows = Cells(Rows.Count, "B").End(xlUp).Row
' Range("B" & lMaxRows + 1).Select
' Range("A").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
' False, Transpose:=False
'End With
End Sub
I'm a notice when it comes to programming. I've been trying to write a macro to have a fixed row in my first file copy to the next open row of my second file. The problem is everytime I run this macro I get a run time error subscript out of range and I don't know why.
'create variable
'strFirstFile = "X:\Resolution\Blue Roof\Emergancy Service Request Form.xls"
'strSecondFile = "X:\Resolution\Blue Roof\Emergancy Service Data gathering form.xls"
'Set wbk = Workbooks("X:\Resolution\Blue Roof\Emergancy Service Request Form.xls")
' Windows(wbk).Activate
' With wbk.Sheets("Sheet3")
' Range("A2:AQ2").Copy
'End With
'Set wbk = Workbooks("X:\Resolution\Blue Roof\Emergancy Service Data gathering form.xls")
' With wbk.Sheets("Sheet1")
' lMaxRows = Cells(Rows.Count, "B").End(xlUp).Row
' Range("B" & lMaxRows + 1).Select
' Range("A").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
' False, Transpose:=False
'End With
End Sub