Public Sub Elimina() Dim nriga As Integer nome = ComboBox2 & ComboBox3 Sheets(nome).Activate nriga = ListView1.SelectedItem.Index + 2 If nriga > 0 Then Sheets(nome).Rows(nriga).Delete ListView1.ListItems.Remove (nriga) End If 'If nriga = "" Then 'MsgBox "Non hai selezionato nulla", 16, vbExclamation, "Errore di compilazione" 'Exit Sub 'End If Application.ScreenUpdating = True End Sub |
Public Sub Elimina() Dim nriga As Integer nome = ComboBox2 & ComboBox3 Sheets(nome).Activate nriga = ListView1.SelectedItem.Index If nriga > 0 Then Sheets(nome).Rows(nriga+2).Delete ListView1.ListItems.Remove (nriga) End If End Sub |
Public Sub Elimina() Dim nriga As Integer nome = ComboBox2 & ComboBox3 Sheets(nome).Activate nriga = ListView1.SelectedItem.Index + 2 End If If nriga > 0 Then Sheets(nome).Rows(nriga).Delete ListView1.ListItems.Remove (nriga - 2) End If Application.ScreenUpdating = True End sub |