volevo chiedervi se c'è una formula che se trova in un Range ,
esempio E5:N200 una cella colorata da una macro,mi cancelli i dati del Range E5:N200
prima
url=http://w[ww.postimage.org/]

e dopo

Moderatori: Anthony47, Flash30005
Sub trova_colore()
Dim a As Single
'Bari
For Each cella In Range("F6:O205")
If cella.Interior.ColorIndex = 3 Then
a = a + 1
End If
Next
Range("F2") = a
If Range("F2").Value = 1 Then
Range("F6:O205").Value = ""
End If
End Sub
Sub trova_colore()
Dim a As Single
'Bari
For Each cella In Range("F6:O205")
If cella.Interior.ColorIndex = 3 Then
a = a + 1
End If
Next
Range("F2") = a
If Range("F2").Value = 1 Then
Range("F6:O205").Value = ""
Range("F2").Value = ""
End If
'Cagliari
For Each cella In Range("P6:Y205")
If cella.Interior.ColorIndex = 3 Then
a = a + 1
End If
Next
Range("P2") = a
If Range("F2").Value = 1 Then
Range("P6:Y205").Value = ""
End If
'Firenze
For Each cella In Range("Z6:AI205")
If cella.Interior.ColorIndex = 3 Then
a = a + 1
End If
Next
Range("Z2") = a
If Range("F2").Value = 1 Then
Range("Z6:AI205").Value = ""
End If
'Genova
For Each cella In Range("AJ6:AS205")
If cella.Interior.ColorIndex = 3 Then
a = a + 1
End If
Next
Range("AJ2") = a
If Range("F2").Value = 1 Then
Range("AJ6:AS205").Value = ""
End If
Sub trova_colore()
Dim a As Single
'Bari
For I=0 to 4 '4 ne ho contati nel tuo esempio
For Each cella In Range("F6").offset(0,I*10).range("A1:J200")
If cella.Interior.ColorIndex = 3 Then
'. . .
'. . .
'. . .
Next cella
Next I
Torna a Applicazioni Office Windows
Mettere tutto MAIUSCOLO un range di celle Autore: raimea |
Forum: Applicazioni Office Windows Risposte: 7 |
Inserire add.in nella barra di avvio veloce in excel 2003 Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 4 |
Excel: problema con date se devo unirle a testi Autore: valle1975 |
Forum: Applicazioni Office Windows Risposte: 5 |
Visitano il forum: Nessuno e 6 ospiti