Questo il codice assegnato al pulsante:
- Codice: Seleziona tutto
Sub Filtrainsufficienza()
Application.ScreenUpdating = False
Sheets("Foglio1").Select
Range("CA3").Select
ActiveCell.FormulaR1C1 = 0
Sheets("Foglio2").Visible = True
Sheets("Foglio2").Select
Range("B10").Select
Selection.AutoFilter
Range("B10:B610").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=1
Range("B8").Select
Application.ScreenUpdating = True
End Sub
E questo assegnato al CommandButton:
- Codice: Seleziona tutto
Private Sub CommandButton3_Click()
Application.ScreenUpdating = False
Sheets("Foglio1").Select
Range("CA3").Select
ActiveCell.FormulaR1C1 = 0
Sheets("Foglio2").Visible = True
Sheets("Foglio2").Select
Range("B10").Select
Selection.AutoFilter
Range("B10:B610").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=1
Range("B8").Select
Application.ScreenUpdating = True
End Sub
Va in debug: “Range("B10").Select”