Ciao a tutti
Ho preparato una cartella, con vari fogli nei quali, in ogni foglio vengono inserite delle lettere ( ogni lettera ha il suo significato). Ora mi serve sapere quante lettere ci sono per ogni Range di celle e questo conteggio deve essere fatto più volte ma nello stesso tempo e nello stesso foglio premendo un tasto, mi spiego: alla pressione di questo tasto, in una tabella deve comparire quante "A", quante "BL", quante "AJ" e così via, ci sono nel range ("f10", "ap74"); sempre con la stessa pressione e nella stessa tabella, deve comparire quante "A", quante "BL", quante "AJ" e così via, ci sono nel range ("f75", "ap121"); ed ancora comparire quante "A", quante "BL", quante "AJ" e così via, ci sono nel range ("f123", "ap195") e continua.
Un mio amico mi ha preparato un programma in VB e mi ha detto di copiarlo ma, mi viene calcolata solo una parte del foglio:
Private Sub CommandButton1_Click()
Dim cell As Range
Dim rp As Integer, p As Integer, c As Integer, cl As Integer, ri As Integer, pl As Integer
rp = 0
For Each cell In Range("f10", "ap74")
If cell = "rp" Then
rp = rp + 1
ElseIf cell = "p" Then
p = p + 1
ElseIf cell = "c" Then
c = c + 1
ElseIf cell = "cl" Then
cl = cl + 1
ElseIf cell = "ri" Then
ri = ri + 1
ElseIf cell = "pl" Then
pl = pl + 1
Else
End If
Next
Range("al2") = rp
Range("am2") = p
Range("ak2") = c
Range("an2") = cl
Range("ao2") = ri
Range("ap2") = pl
End
Continue;
For Each cell In Range("f70", "ap121")
If cell = "rp" Then
rp = rp + 1
ElseIf cell = "p" Then
p = p + 1
ElseIf cell = "c" Then
c = c + 1
ElseIf cell = "cl" Then
cl = cl + 1
ElseIf cell = "ri" Then
ri = ri + 1
ElseIf cell = "pl" Then
pl = pl + 1
Else
End If
Next
Range("al3") = rp
Range("am3") = p
Range("ak3") = c
Range("an3") = cl
Range("ao3") = ri
Range("ap3") = pl
End Sub
Qualcuno sa darmi un aiuto?
Grazie in anticipo.

Rispondi quotando
