volevo realizzare una macro che eliminasse tutte le righe che contengono nella prima colonna un valore maggiore di 200
avevo questa macro che eliminava tutte le righe che alla colonna 5 avevano il valore zero
Sub elim()
Sheets("ele").Select
Range("A4:E700").Select
Selection.Copy
Sheets("giocatori").Select
Range("A21").Select
ActiveSheet.Paste
Application.ScreenUpdating = False
With ActiveSheet
righe = Range("E65536").End(xlUp).Row
End With
cont = 0
i = 1
While Cells(i, 5) <> ""
If Cells(i, 5) = 0 Then
Range(Cells(i + 1, 1), Cells(righe - cont, 5)).Copy Destination:=Cells(i, 1)
cont = cont + 1
i = i - 1
End If
i = i + 1
Wend
Range(Cells(i - cont, 1), Cells(i, 5)).ClearContents
Application.ScreenUpdating = True
Sheets("SVINCOLATI").Select
End Sub
ho effettuato queste modifiche ma non funzionaSub eli()
Application.ScreenUpdating = False
With ActiveSheet
righe = Range("A65536").End(xlUp).Row
End With
cont = 0
i = 1
While Cells(i, 1) <> ""
If Cells(i, 1) > 200 Then
Range(Cells(i + 1, 1), Cells(righe - cont, 1)).Copy Destination:=Cells(i, 1)
cont = cont + 1
i = i - 1
End If
i = i + 1
Wend
Range(Cells(i - cont, 1), Cells(i, 1)).ClearContents
Application.ScreenUpdating = True
Sheets("ele").Select
End Sub