Sub quesito2()
Dim rg As Integer, col As Integer, i As Integer, somma As Double, recente As Date, carattere As String
somma = 0
i = 5
For rg = 1 To 2
col = 1
Do While Not IsEmpty(Cells(rg, col))
If IsNumeric(Cells(rg, col).Value) Then
somma = somma + Cells(rg, col).Value
ElseIf IsDate(Cells(rg, col).Value) Then
If Cells(1, col).Value < Cells(2, col).Value Then
recente = Cells(2, col).Value
Else
recente = Cells(1, col).Value
End If
Else
If Len(Cells(1, col).Value) > Len(Cells(2, col).Value) Then
carattere = Cells(1, col).Value
Else
carattere = Cells(2, col).Value
End If
End If
col = col + 1
Loop
Cells(i, 1) = somma
Cells(i + 1, 1) = carattere
Cells(i + 2, 1) = recente
Next
End Sub
|