Kod:
Private Sub CommandButton15_Click()
Set sht = Sheets("HAMMADDE_LİSTESİ")
ss = sht.Cells(sht.Rows.Count, "A").End(xlUp).Row
For kk = 7 To ss
LastRow = Cells.Find(What:="#", After:=Cells(kk, 1), SearchOrder:=xlRows, SearchDirection:=xlPrevious).Row
Nextrow = Cells.Find(What:="#", After:=Cells(kk, 1), SearchOrder:=xlRows, SearchDirection:=xlNext).Row
cnt = Range("A" & LastRow & ":A" & Nextrow).Rows.Count
For i = 1 To cnt
ery = Cells(LastRow, 2).Value
If Range("A" & kk).Value <> "#" Then
Range("A" & kk).Value = Left(Range("N" & kk).Value, 1) & "." & Left(Range("M" & kk).Value, 1) & "." & Right(ery, 4) & "." & 1000 + i
End If
Next
Next
End Sub
Yukarıdaki kod ile "#" ile başlayan satırların sonunda her grup için ne kadar satır varsa sayıp .1001 .1002 gibi kod oluşturmasını istiyorum. Hata nerde bulamıyorum?
