Keresés

Új hozzászólás Aktív témák

  • poffsoft

    veterán

    válasz Delila_1 #28076 üzenetére

    picit faragtam a makrót, ha a feladatot jól értettem:
    Sub SorTorles()
    Dim sor As Long, usor As Long
    Dim lapsor As Integer
    Dim fejlec As Integer
    Dim aktsor As Integer

    usor = Range("A" & Rows.Count).End(xlUp).Row
    lapsor = 10
    fejlec = 3
    aktsor = fejlec + 1
    For sor = aktsor To usor
    If (sor - 1) Mod lapsor = 0 Then sor = sor + fejlec
    Do While Application.WorksheetFunction.CountA(Rows(aktsor)) = 0 And aktsor <= usor
    aktsor = aktsor + 1
    If (aktsor - 1) Mod lapsor = 0 Then aktsor = aktsor + fejlec
    Loop
    If Application.WorksheetFunction.CountA(Rows(sor)) = 0 Then
    Rows(aktsor).Select
    Selection.Copy
    Application.CutCopyMode = False
    Selection.Cut
    Rows(sor).Select
    ActiveSheet.Paste
    End If
    aktsor = aktsor + 1
    If (aktsor - 1) Mod lapsor = 0 Then aktsor = aktsor + fejlec
    If aktsor >= usor Then Exit For
    Next
    End Sub

    lapsor: hány soronként jön a fejléc
    fejlec: hány soros a fejléc

    :B

Új hozzászólás Aktív témák