Hi I am gettin a run time error when trying to use the below macro in VBA. It opens the file but then doesnt do anything else and returns me the error message. Sub Macro3() | ||
Dim qfile(), i As Integer | ||
Dim thiswb As Workbook, datawb As Workbook | ||
Dim qrow As Integer | ||
Set thiswb = ActiveWorkbook | ||
Sheets("Sheet1").Range("A2").Select | ||
qfile = Array("G:\Finance, Performance & Business Planning\Management Accounts\2015 Budget\Working templates\1st Issue\Business Development.*", _ | ||
"G:\Finance, Performance & Business Planning\2012_Business Planning\3 yr Budget & planning\2013 budgets and plans\Budgets Received\Customer engagement.*") | ||
For i = O To UBound(qfile) | ||
Workbooks.Open Filename:=qfile(i), ReadOnly:=True | ||
Set datawb = ActiveWorkbook | ||
Sheets("Sheet1").Select | ||
qrow = Cells(Rows.Count, 1).End(xlUp).Row | ||
Range("A7").Select | ||
Do Until ActiveCell.Row = qrow | ||
If ActiveCell.Value <> "" Then | ||
ActiveCell.EntireRow.Copy | ||
thiswb.Activate | ||
ActiveCell.PasteSpecial xlPasteValues | ||
ActiveCell.Offset(1, 0).Select | ||
datawb.Activate | ||
ActiveCell.Offset(1, 0).Select | ||
Else | ||
ActiveCell.Offset(1, 0).Select | ||
End If | ||
Loop | ||
datawb.Close SaveChanges:=False | ||
Next i | ||
End Sub |
<colgroup><col style="width: 48pt;" span="3" width="64"> <tbody>
</tbody>