Suma Por Color Y Formato Condicional

Solo consultas sobre macros y código VBA Excel.

Reglas del Foro
1. Antes de hacer tu pregunta intenta con el buscador de este foro (muchas preguntas ya fueron respondidas antes!)
2. Si haces una nueva pregunta, es muy recomendable que adjuntes el ejemplo Excel para poder comprenderla mejor!
3. Realiza tu pregunta de forma clara, explicando bien cada paso de lo que haces y tendrás más probabilidad de respuesta!
Compartir en:
     

Suma Por Color Y Formato Condicional

Notapor spawn » 22 Sep 2006 19:13

SALUDOS, QUISIERA VER SI ALGUIEN ME PUEDE AYUDAR, NECESITO SABER LA FORMA DE UTILIZAR UNA MACRO DE SUMA POR COLOR CONVINADO CON FORMATO CONDICIONAL.

HE VISTO MUCHOS EJERCICIOS PARA SUMAR CELDAS CON UN DETERMINADO COLOR UTILIZANDO LA FUNCION SUMBYCOLOR, COMO SIGUE:

Function SumByColor(InRange As Range, WhatColorIndex As Integer, _
Optional OfText As Boolean = False) As Double

Dim Rng As Range
Dim OK As Boolean

Application.Volatile True
For Each Rng In InRange.Cells
If OfText = True Then
OK = (Rng.Font.ColorIndex = WhatColorIndex)
Else
OK = (Rng.Interior.ColorIndex = WhatColorIndex)
End If
If OK And IsNumeric(Rng.Value) Then
SumByColor = SumByColor + Rng.Value
End If
Next Rng

End Function

SIN EMBARGO, ESTA FUNCION NO SIRVE SI ALGUNO DE LOS COLORES DE LAS CELDAS A SUMAR VIENE DE UN FORMATO CONDICIONAL.

POR FAVOR AYUDENME A VER COMO SE PUEDE REALIZAR ESTO.

GRACIAS.
No tiene los permisos requeridos para ver los archivos adjuntos a este mensaje.
* Te recomendamos estos productos Excel: Manual de Macros | Manual de Funciones | Nuevas Funciones | ddTraDa
spawn
Miembro Frecuente
Miembro Frecuente
 
Registrado: 02 Sep 2005 18:49

Re: Suma Por Color Y Formato Condicional

Notapor jimcov » 26 Sep 2006 20:15

Hola Spawn

Aqui te envio una solucion

jimcov
No tiene los permisos requeridos para ver los archivos adjuntos a este mensaje.
* Te recomendamos estos productos Excel: Manual de Macros | Manual de Funciones | Nuevas Funciones | ddTraDa
Avatar de Usuario
jimcov
Miembro Frecuente
Miembro Frecuente
 
Registrado: 01 Ago 2005 01:11

Re: Suma Por Color Y Formato Condicional

Notapor spawn » 29 Sep 2006 15:09

JIMCOV ERES UN GENIO, MUCHAS GRACIAS, FUNCIONA PERFECTO.
* Te recomendamos estos productos Excel: Manual de Macros | Manual de Funciones | Nuevas Funciones | ddTraDa
spawn
Miembro Frecuente
Miembro Frecuente
 
Registrado: 02 Sep 2005 18:49

Re: Suma Por Color Y Formato Condicional

Notapor petra » 22 May 2012 08:43

HOLA, ME PORDRÍAS COLGAR LA RESPUESTA. yA NO ESTÁ DISPONIBLE. TENGO EL MISMO PROBLEMA QUE EL CHAVAL ANTERIOR.

GRACIAS
* Te recomendamos estos productos Excel: Manual de Macros | Manual de Funciones | Nuevas Funciones | ddTraDa
petra
Miembro Nuevo
Miembro Nuevo
 
Registrado: 22 May 2012 08:26


Compartir en:
     

  • Anuncio
Manual Excel avanzado

Volver a Macros

¿Quién está conectado?

Usuarios navegando por este Foro: Bing [Bot], Google [Bot] y 6 invitados