Vereinfachen einer Schleife
Hallo, ich bin neu und versuche mich jetzt mit VBA
Ich möchte die Funktion Autofill durch eine Schleife ersetzen. Die Schleife soll sollange betrieben werden bis in der Spalte U der wert 0 oder leer angezeigt wird.
Sub Ergebnis()
Range("U5").Select
ActiveCell.FormulaR1C1 = "=IF(AND(RC[1]=1,RC[2]=1),1,0)"
Range("U5").Select
Selection.AutoFill Destination:=Range("U5:U10000"), Type:=xlFillDefault
Range("U5:U10000").Select
End Sub
Ich möchte die Funktion Autofill durch eine Schleife ersetzen. Die Schleife soll sollange betrieben werden bis in der Spalte U der wert 0 oder leer angezeigt wird.
Sub Ergebnis()
Range("U5").Select
ActiveCell.FormulaR1C1 = "=IF(AND(RC[1]=1,RC[2]=1),1,0)"
Range("U5").Select
Selection.AutoFill Destination:=Range("U5:U10000"), Type:=xlFillDefault
Range("U5:U10000").Select
End Sub
Please also mark the comments that contributed to the solution of the article
Content-Key: 277295
Url: https://administrator.de/contentid/277295
Printed on: April 26, 2024 at 04:04 o'clock
1 Comment
Hallo Jens,
Gruß grexit
With ActiveSheet
.Range("U5").AutoFill Destination:=.Range("U5:U" & .Cells(Rows.Count,"U").End(xlUp).Row), Type:=xlFillDefault
End With