cancellare righehelp



  • mancini6864
    di mancini6864 data: 13/05/2015 16:16:56

    prova questa macro ho considerato che il valore 0 si trovasse nella colonna D

    quidi basta modificare la D con una lettere a tuo piacere
     
    Sub elimina_righe()
    
    Dim ur As Integer, riga As Integer
    Dim col As String
    col = InputBox("D", "Input_colonna")
    If col = "" Then Exit Sub
    
    On Error GoTo fine
    ur = Cells(Rows.Count, col).End(xlUp).Row
    If ur = 1 Then Exit Sub
    
    For riga = ur To 1 Step -1
    If IsError(Cells(riga, col)) Then Rows(riga).Delete
    If Cells(riga, col).Value = "0" Then Rows(riga).Delete
    Next
    
    fine:
    MsgBox "F"
    End Sub