'---------------------------------------------------------------- 'cancella tutto dopo l'ultima riga valida 'Dim WS As Worksheet 'Dim LastCell As Range 'Dim LastCellRowNumber As Long Set WS = Worksheets("dividi") 'nome foglio ActiveSheet.Unprotect "123456" With WS Set LastCell = .Cells(.Rows.Count, "A").End(xlUp) 'colonna A LastCellRowNumber = LastCell.Row Rows(LastCellRowNumber + 1 & ":" & Rows.Count).ClearContents End With '----------------------------------------------------------------