Hallo Klaus,
leider ist die Anforderung geändert worden.
Es sollen jetzt immer 100 Zeilen zusammengefasst werden.
Ich habe das angepasst wie von Dir vorbereitet.
Hier meine Änderung:
Sub Zertnummern()
Dim i As Long
Dim lngLast As Long
'letzte Zeile von Spalte A
lngLast = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False
'Formeln setzen
For i = 2 To lngLast Step 100
Range("E" & i).FormulaR1C1 = _
"=RC[-4]&"",""&"" ""&R[1]C[-4]&"",""&"" ""&R[2]C[-4]&"",""&"" ""&R[3]C[-4]&"",""&"" ""&R[4]C[-4]&"",""&"" ""&R[5]C[-4]&"","" &"" ""&R[6]C[-4]&"",""&"" ""&R[7]C[-4]&"",""&"" ""&R[8]C[-4]&"",""&"" ""&R[9]C[-4]&"",""&"" ""&R[10]C[-4]&"",""&"" ""&R[11]C[-4]&"",""&"" ""&R[12]C[-4]&"",""&"" ""&R[13]C[-4]&"",""&"" ""&R[14]C[-4]&"",""&"" ""&R[15]C[-4]&"",""&"" ""&R[16]C[-4]&"",""&"" ""&R[17]C[-4]&"",""&"" ""&R[18]C[-4]&"",""&"" ""&R[19]C[-4]&"",""&"" ""&R[20]C[-4]&"",""&"" ""&R[21]C[-4]&"",""&"" ""&R[22]C[-4]&"",""&"" ""&R[23]C[-4]&"",""&"" ""&R[24]C[-4]&"",""&"" ""&R[25]C[-4]&"",""&"" ""&R[26]C[-4]&"",""&"" ""&R[27]C[-4]&"",""&"" ""&R[28]C[-4]&"",""&"" ""&R[29]C[-4]&"",""&"" ""&R[30]C[-4]&"",""&"" ""&R[31]C[-4]&"",""&"" ""&R[32]C[-4]&"",""&"" ""&R[33]C[-4]&"",""&"" ""&R[34]C[-4]&"",""&"" ""&R[35]C[-4]&"",""&"" ""&R[36]C[-4]&"",""&"" ""&R[37]C[-4]&"",""&"" ""&R[38]C[-4]&"",""&"" ""&R[39]C[-4]&"",""&"" ""&R[40]C[-4]&"",""&"" ""&R[41]C[-4]&"",""&"" ""&R[42]C[-4]&"",""&"" ""&R[43]C[-4]&"",""&"" ""&R[44]C[-4]"
&"",""&"" ""&R[45]C[-4]&"",""&"" ""&R[46]C[-4]&"",""&"" ""&R[47]C[-4]&"",""&"" ""&R[48]C[-4]&"",""&"" ""&R[49]C[-4]&"",""&"" ""&R[50]C[-4]&"",""&"" ""&R[51]C[-4]&"",""&"" ""&R[52]C[-4]&"",""&"" ""&R[53]C[-4]&"",""&"" ""&R[54]C[-4]&"",""&"" ""&R[55]C[-4]&"",""&"" ""&R[56]C[-4]&"",""&"" ""&R[57]C[-4]&"",""&"" ""&R[58]C[-4]&"",""&"" ""&R[59]C[-4]&"",""&"" ""&R[60]C[-4]&"",""&"" ""&R[61]C[-4]&"",""&"" ""&R[62]C[-4]&"",""&"" ""&R[63]C[-4]&"",""&"" ""&R[64]C[-4]&"",""&"" ""&R[65]C[-4]&"",""&"" ""&R[66]C[-4]&"",""&"" ""&R[67]C[-4]&"",""&"" ""&R[68]C[-4]&"",""&"" ""&R[69]C[-4]&"",""&"" ""&R[70]C[-4]&"",""&"" ""&R[71]C[-4]&"",""&"" ""&R[72]C[-4]&"",""&"" ""&R[73]C[-4]&"",""&"" ""&R[74]C[-4]&"",""&"" ""&R[75]C[-4]&"",""&"" ""&R[76]C[-4]&"",""&"" ""&R[77]C[-4]&"",""&"" ""&R[78]C[-4]&"",""&"" ""&R[79]C[-4]&"",""&"" ""&R[80]C[-4]&"",""&"" ""&R[81]C[-4]&"",""&"" ""&R[82]C[-4]&"",""&"" ""&R[83]C[-4]&"",""&"" ""&R[84]C[-4]&"",""&"" ""&R[85]C[-4]&"",""&"" ""&R[86]C[-4]&"",""&"" ""&R[87]C[-4]&"",""&"" ""&R[88]C[-4]
&"",""&"" ""&R[89]C[-4]&"",""&"" ""&R[90]C[-4]&"",""&"" ""&R[91]C[-4]&"",""&"" ""&R[92]C[-4]&"",""&"" ""&R[93]C[-4]&"",""&"" ""&R[94]C[-4]&"",""&"" ""&R[95]C[-4]&"",""&"" ""&R[96]C[-4]&"",""&"" ""&R[97]C[-4]&"",""&"" ""&R[98]C[-4]&"",""&"" ""&R[99]C[-4]&"",""&"" ""&R[100]C[-4]"
Next i
'Formeln werden Value
Range("E2:E" & lngLast).Value = Range("E2:E" & lngLast).Value
'Loeschen
Range("E2:E" & lngLast).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Application.ScreenUpdating = True
End Sub
Da jetzt die Zeile "=RC[-4]&"",""&"" ""&....... bis 100 fortgeführt wird findet ein Zeilenumbruch statt, der angemostert wird.
Wie kann ich umgehen?
Salü
Joachim