R
Ripan
I am writing a macro that copies rows from one workbook into a ne
workbook if they satisfy a condition. I have a loop as follows:
With ActiveWorkbook.Worksheets("Master Input")
Do While .Cells(i, 1).Value <> ""
If <Condition> Then
.Rows(i).Select 'ERROR LINE
Workbooks("Data Capture").Activate
Worksheets("Master Input").Activate
Range(.Cells(rowPos)).PasteSpecial xlPasteValues
Workbooks(filename).Activate
rowPos = rowPos + 1
End If
i = i + 1
Loop
End With
The .Rows(i).Select command gives me the following error message:
Select Method of Range Class Failed.
Any help on how to fix this error?
Thank
workbook if they satisfy a condition. I have a loop as follows:
With ActiveWorkbook.Worksheets("Master Input")
Do While .Cells(i, 1).Value <> ""
If <Condition> Then
.Rows(i).Select 'ERROR LINE
Workbooks("Data Capture").Activate
Worksheets("Master Input").Activate
Range(.Cells(rowPos)).PasteSpecial xlPasteValues
Workbooks(filename).Activate
rowPos = rowPos + 1
End If
i = i + 1
Loop
End With
The .Rows(i).Select command gives me the following error message:
Select Method of Range Class Failed.
Any help on how to fix this error?
Thank