Makro zusammenführen
Mat
ich habe drei Einzelmakros und würde diese gerne als ein Makro oder zumindest automatisch hintereinander ablaufen lassen.
Sub verteile_personaln()
Dim i As Long
Dim lastrow As Long
Dim vname As String
lastrow = Cells(Rows.Count, 2).End(xlUp).Row
Cells(1, 1).Value = vname
For i = 1 To lastrow
If Cells(i, 1).Value = Empty Then
Cells(i, 1).Value = vname
Else:
vname = Cells(i, 1).Value
End If
Next i
End Sub
Sub verteile_name()
Dim i As Long
Dim lastrow As Long
Dim vname As String
lastrow = Cells(Rows.Count, 2).End(xlUp).Row
Cells(1, 2).Value = vname
For i = 2 To lastrow
If Cells(i, 2).Value = Empty Then
Cells(i, 2).Value = vname
Else:
vname = Cells(i, 2).Value
End If
Next i
End Sub
Sub verteile_abteil()
Dim i As Long
Dim lastrow As Long
Dim vname As String
lastrow = Cells(Rows.Count, 2).End(xlUp).Row
Cells(1, 3).Value = vname
For i = 1 To lastrow
If Cells(i, 3).Value = Empty Then
Cells(i, 3).Value = vname
Else:
vname = Cells(i, 3).Value
End If
Next i
End Sub
Wer kann mir dabei helfen.Gruß Mat