ich habe diese Formel:~f~
=TEXT(A2;" 00")&TEXT(B2;" 000")&TEXT(C2;" 00000")
ich möchte gern diese Formel per Makro nach unten kopieren, bis die letzte Zelle in der Spalte "C" belegt ist.
gruß walter MB
Sub CopyDown()
Dim lastRow As Long
If Selection.Cells.Count > 1 Then
MsgBox "Es darf nur eine Zelle markiert werden"
Exit Sub
End If
If ActiveCell.Column = 1 Then
MsgBox "Was soll denn hier kopiert werden wenn links keine Daten stehen ;-) "
Exit Sub
End If
lastRow = Cells(Rows.Count, ActiveCell.Offset(0, -1)).End(xlUp).Row
ActiveCell.AutoFill Destination:=Range("" & ActiveCell.Address(0, 0) & ":" & Cells(lastRow, ActiveCell.Column).Address(0, 0) & "")
End Sub
Sub CopyDown()
Dim lastRow As Long
If Selection.Cells.Count > 1 Then
MsgBox "Es darf nur eine Zelle markiert werden"
Exit Sub
End If
If ActiveCell.Column = 1 Then
MsgBox "Was soll denn hier kopiert werden wenn links keine Daten stehen ;-) "
Exit Sub
End If
lastRow = Cells(Rows.Count, ActiveCell.Offset(0, -1)).End(xlUp).Row
ActiveCell.AutoFill Destination:=Range("" & ActiveCell.Address(0, 0) & ":" & Cells(lastRow, ActiveCell.Column).Address(0, 0) & "")
End Sub
A | B | C | |
1 | Wert1 | Wert2 | Wert3 |
2 | 5 | 7 | 9 |
3 | 4 | 77 | 7680 |
4 | 3 | 17 | 9891 |
5 | 5 | 26 | 6624 |
6 | 1 | 77 | 3367 |