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

  • poffsoft

    addikt

    válasz morgusz #28171 üzenetére

    upsz, kis hiba maradt,
    az a selection.clear nem kell a vége felé!

    Sub proba()
    Dim lista() As String
    Dim i As Long
    Dim usor As Long ' last used row in source sheet
    Dim lrow As Long ' last row in this sheet
    Dim scol As Long ' first column of actual formulas source
    Dim ecol As Long ' last column of actual formulas source

    lista = Split("Munka1,Munka2,Munka3,Munka4,Munka5,Munka6,Munka7,Munka8,Munka9", ",")
    Worksheets(lista(0)).Activate
    For i = 1 To UBound(lista)
    usor = Worksheets(lista(i)).UsedRange.Rows.Count
    scol = ((i - 1) * 4) + 1
    ecol = ((i - 1) * 4) + 3
    lrow = Range(Cells(3, scol), Cells(Rows.Count, ecol)).End(xlUp).Row
    If lrow < 3 Then lrow = 3

    ActiveSheet.Range(Cells(3, scol), Cells(lrow, ecol)).Clear

    Range(Cells(2, scol), Cells(2, ecol)).Copy Destination:=Range(Cells(3, scol), Cells(usor, ecol))
    Next i
    End Sub

    [ Szerkesztve ]

    [ Szerkesztve ]

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