Home › Forum › Domande su Excel VBA e MACRO › [RISOLTO] Cancellare il contenuto di un intervallo in base a determinato valore › Rispondi a: [RISOLTO] Cancellare il contenuto di un intervallo in base a determinato valore
Ciao
Una possibile soluzione, sicuramente migliorabile
Sub CANCELLA_DATI()
Dim WS As Worksheet
Dim rng As Range, cl As Range
Set WS = Sheets("Visite")
Set rng = WS.Range("A1").CurrentRegion 'da adattare al tuo range
For Each cl In rng.Columns(9).Range("A2").Resize(rng.Rows.Count - 1)
If cl.Value = "cancellare" Then
cl.Offset(, -8).Resize(, 6).ClearContents
End If
Next cl
Set rng = Nothing
Set WS = Nothing
End Sub
Saluti