Method 'Range' of object '_Worksheet' failed

09/01/2008 - 09:18 von Mike | Report spam
Hallo,

kann mir bitte jemand erklàren, warum das Macro1 funktioniert und das Macro2
nicht?

Vielen Dank!

Mike
Sub MACRO1()
'Delete
Sheet3.Range(Cells(2, 1), Cells(Range("A2").End(xlDown).Row,
Range("A2").End(xlToRight).Column)).ClearContents

Sheet4.Select
Sheet4.Range(Cells(2, 1), Cells(Range("A2").End(xlDown).Row,
Range("A2").End(xlToRight).Column)).Copy

Sheet3.Select
Sheet3.Range("A2").PasteSpecial xlPasteValues

Sheet5.Select
Sheet5.Range(Cells(2, 1), Cells(Range("A2").End(xlDown).Row,
Range("A2").End(xlToRight).Column)).Copy

Sheet3.Select
Sheet3.Range("A2").End(xlDown).Offset(1, 0).PasteSpecial xlPasteValues

Application.CutCopyMode = False
Application.ScreenUpdating = False
End Sub
-
Sub MACRO2()
Sheet3.Range(Cells(2, 1), Cells(Range("A2").End(xlDown).Row,
Range("A2").End(xlToRight).Column)).ClearContents

Sheet4.Range(Cells(2, 1), Cells(Range("A2").End(xlDown).Row,
Range("A2").End(xlToRight).Column)).Copy
Sheet3.Range("A2").PasteSpecial xlPasteValues

Sheet5.Range(Cells(2, 1), Cells(Range("A2").End(xlDown).Row,
Range("A2").End(xlToRight).Column)).Copy
Sheet3.Range("A2").End(xlDown).Offset(1, 0).PasteSpecial xlPasteValues

Application.CutCopyMode = False
Application.ScreenUpdating = False
End Sub
 

Lesen sie die antworten

#1 Michael Mueller
09/01/2008 - 09:29 | Warnen spam
Mal ein Schnellschuß:
Analog zum Macro1 das Ballt in dem Eingefügt werden soll auswàhlen.

Sub MACRO2()
Sheet3.Range(Cells(2, 1), Cells(Range("A2").End(xlDown).Row,
Range("A2").End(xlToRight).Column)).ClearContents

Sheet4.Range(Cells(2, 1), Cells(Range("A2").End(xlDown).Row,
Range("A2").End(xlToRight).Column)).Copy



Sheet3.Select

Sheet3.Range("A2").PasteSpecial xlPasteValues

Sheet5.Range(Cells(2, 1), Cells(Range("A2").End(xlDown).Row,
Range("A2").End(xlToRight).Column)).Copy



Sheet3.Select

Sheet3.Range("A2").End(xlDown).Offset(1, 0).PasteSpecial xlPasteValues

Application.CutCopyMode = False
Application.ScreenUpdating = False
End Sub



HTH
Michi

Ähnliche fragen