I am currently getting the following error in my VBA Excel 2007 code: Run-time error \'1004\': Method \'Range\'of object \'_Worksheet\' failed. Having peeled through quite a
Update this section:
If SaveRedAns = 6 Then
With AccDnn
.Range(.Cells(2, 71), .Cells(RangéeFinAcc - 1, 87)).Copy
.Cells(RangéeFinRed - 18, 71).PasteSpecial (xlPasteValues)
End With
With DrpRed
.Range(.Cells(19, 1), .Cells(RangéeFinRed, 16)).Copy
End With
AccDnn.Cells(2, 75).PasteSpecial (xlPasteValues)
Else: SaveRedAns = 7
Application.ScreenUpdating = True
Exit Sub
End If
Or without using With
statements:
If SaveRedAns = 6 Then
AccDnn.Range(AccDnn.Cells(2, 71), AccDnn.Cells(RangéeFinAcc - 1, 87)).Copy
AccDnn.Cells(RangéeFinRed - 18, 71).PasteSpecial (xlPasteValues)
DrpRed.Range(DrpRed.Cells(19, 1), DrpRed.Cells(RangéeFinRed, 16)).Copy
AccDnn.Cells(2, 75).PasteSpecial (xlPasteValues)
Else: SaveRedAns = 7
Application.ScreenUpdating = True
Exit Sub
End If