Sub giorni()
Dim conta As Integer
Dim ws As Worksheet
Dim rng As Range, row_ As Range, cell As Range, c As Range, row1_ As Range, rr As Long, rrr As Long
Dim tot_giorni As Integer, nome2 As String, f As String, nome As String, nome1 As String, ultimariga As Long, i As Long
ur = ActiveSheet.UsedRange.SpecialCells(xlLastCell, xlNumbers).Row ' ULTIMA RIGA PIENA
uc = ActiveSheet.UsedRange.SpecialCells(xlLastCell, xlNumbers).Column ' ULTIMA COLONNA PIENA
rr = 4 ' colonna di partenza presenze
rrr = 3 ' colonna di partenza nome record
rrrr = 2 '
For y = 7 To ur
Cells(y, rr).Select
For x = 4 To uc
If ActiveCell.Interior.ColorIndex = 5 Then
nome = Cells(y, rrr) 'nome record
nome1 = Cells(6, x) ' giorno
nome2 = Cells(5, x) ' mese
Set c = Sheets("riepilogo").Range("c:c").Find(nome)
c.Offset(, rrrr) = c.Offset(, rrrr) + nome1
rrrr = rrrr + 1
End If
Selection.Offset(, 1).Select
Next
rrrr = 2
Next
End Sub
|