Esta es la macro completa para poner el max y el min
Private sub estilo_change()
'Por.dante amor
set h = sheets("datos historicos")
set h3 = sheets("hoja3")
set b = h.columns("a").find(estilo, lookat:=xlwhole, lookin:=xlvalues)
if estilo = "" then
for each c in controls
if typename(c) = "textbox" then c.value = ""
next
exit sub
end if
'
if b is nothing then
for each c in controls
if typename(c) = "textbox" then c.value = ""
next
exit sub
end if
nombre = h.cells(b.row, "b")
h3.[b2] = iif(isnumeric(estilo), val(estilo), estilo)
'
on error resume next
if optionbutton1 then
centimetros = round(application.averageif(columns("a"), estilo, columns("c")))
densidad = round(application.averageif(columns("a"), estilo, columns("d")))
pesocrudo = round(application.averageif(columns("a"), estilo, columns("f")))
mallas = round(application.averageif(columns("a"), estilo, columns("h")))
columnas = round(application.averageif(columns("a"), estilo, columns("i")))
pesolavado = round(application.averageif(columns("a"), estilo, columns("n")))
'
bastidor = format(application.averageif(columns("a"), estilo, columns("e")), "#.00")
anchocrudo = format(application.averageif(columns("a"), estilo, columns("g")), "#.00")
estiraje = format(application.averageif(columns("a"), estilo, columns("j")), "#.00")
tensioneslicra = format(application.averageif(columns("a"), estilo, columns("k")), "#.00")
tensioneshilo = format(application.averageif(columns("a"), estilo, columns("l")), "#.00")
ancholavado = format(application.averageif(columns("a"), estilo, columns("m")), "#.00")
end if
'
if optionbutton2 then
centimetros = h3.cells(3, "c")
densidad = h3.cells(3, "d")
pesocrudo = h3.cells(3, "f")
mallas = h3.cells(3, "h")
columnas = h3.cells(3, "i")
pesolavado = h3.cells(3, "n")
'
bastidor = h3.cells(3, "e")
anchocrudo = h3.cells(3, "g")
estiraje = h3.cells(3, "j")
tensioneslicra = h3.cells(3, "k")
tensioneshilo = h3.cells(3, "l")
ancholavado = h3.cells(3, "m")
end if
if optionbutton3 then
centimetros = h3.cells(2, "c")
densidad = h3.cells(2, "d")
pesocrudo = h3.cells(2, "f")
mallas = h3.cells(2, "h")
columnas = h3.cells(2, "i")
pesolavado = h3.cells(2, "n")
'
bastidor = h3.cells(2, "e")
anchocrudo = h3.cells(2, "g")
estiraje = h3.cells(2, "j")
tensioneslicra = h3.cells(2, "k")
tensioneshilo = h3.cells(2, "l")
ancholavado = h3.cells(2, "m")
end if
End sub