formula a macro

27/06/2005 - 15:25 por Max | Informe spam
Hola
Desearia saber si hay la posibildad de reemplazar esta formula que
tengo a
un macro .
=MAX(A1:A10)+MAX(B1:B10)+MAX(C1:C10)
 

Leer las respuestas

#1 fernandocarrillo
27/06/2005 - 17:00 | Informe spam
Hola,

prueba esta macro:


sub maxima()

x = 1
'inicializa valores maximos
maxA = Cells(x, 1).Value
maxB = Cells(x, 2).Value
maxC = Cells(x, 3).Value
While x <= 10
If Cells(x, 1).Value > maxA Then maxA = Cells(x, 1).Value
If Cells(x, 2).Value > maxB Then maxB = Cells(x, 2).Value
If Cells(x, 3).Value > maxC Then maxC = Cells(x, 3).Value
x = x + 1
Wend

'esto es solo para que sepas qué valor máximo quedó en cada columna
Cells(12, 1).Value = maxA
Cells(12, 2).Value = maxB
Cells(12, 3).Value = maxC

Cells(12, 4).Value = maxA + maxB + maxC

End Sub


Suerte,

Fernando






Max Wrote:
Hola
Desearia saber si hay la posibildad de reemplazar esta formula que
tengo a
un macro .
=MAX(A1:A10)+MAX(B1:B10)+MAX(C1:C10



fernandocarrill
fernandocarrillo's Profile: http://www.msusenet.com/member.php?userid&4
View this thread: http://www.msusenet.com/t-187056753

Preguntas similares