miércoles, 26 de agosto de 2009

Subtotales en excel 2007

Notese como aca se utiliza y ordena las celdas para poder usar los subtotales y obtener operaciones parciales en una tabla de datos.

4 comentarios:

  1. a decir verdad desearia que me ayude con macros a como realizarlo porque necesito dar una clase que tengo como tarea en la universidad son 5 ejercicios de macros los cuales necesito presentar si fuera tan amable esta es mi direccion de correo robertorivera25@hotmail.com gracias de antemano muy bueno su blog

    ResponderEliminar
  2. Anónimo te anexo un ejemplo de como yo agrego subtotales.
    De igual forma puedes declarar una variable array de tipo byte o integer y asignar los numeros de columna.

    Saludos,

    Atte.
    Erik Copado Perez

    Dim Col(57) as Integer
    col = array(9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 28, 30, 32, _
    35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 54, 56, 58, _
    61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, 78, 80, 82, 84)

    Function:=xlSum, TotalList:=col, _
    Replace:=True, PageBreaks:=False, SummaryBelowData:=True


    Public Sub AgregaSubtotales()
    Dim Rango As String
    Rango = "A6:CH6"
    Range(Rango).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array( _
    9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 28, 30, 32, _
    35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 54, 56, 58, _
    61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, 78, 80, 82, 84), _
    Replace:=True, PageBreaks:=False, SummaryBelowData:=True

    Range(Rango).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array( _
    9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 28, 30, 32, _
    35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 54, 56, 58, _
    61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, 78, 80, 82, 84), _
    Replace:=False, PageBreaks:=False, SummaryBelowData:=True

    ActiveSheet.Outline.ShowLevels RowLevels:=2

    Range(Rango).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Subtotal GroupBy:=3, Function:=xlSum, TotalList:=Array( _
    9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 28, 30, 32, _
    35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 54, 56, 58, _
    61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, 78, 80, 82, 84), _
    Replace:=False, PageBreaks:=False, SummaryBelowData:=True

    ActiveSheet.Outline.ShowLevels RowLevels:=2

    Range("H7").Select
    End Sub

    ResponderEliminar
  3. SR JOSE BUENAS GHRACIAS POR LAS TUTORIAS QUE DA ACERCXA DE EXCEL, TENGO UN PROBLEMA CON MI MACROS, HAGO TODO LO QUE USTED DICE, LOS PASOS A SEGUIR, PERO EN EL RATO DE APLICAR LA MACROS NO FUNCIONA PORQUE, ME SALE EL MENSAJE DEBIDO A SU CONFIGURACION DE SEGURIDAD, SE HAN DESHABILITADO LAS MACROS, HELP ME PLEASE.
    ATTE
    MIGUEL

    ResponderEliminar
  4. HOLA ME LLAMO WALTER DE EL SALVADOR YO ESTOY APRENDIIENDO SOBRE MACRO Y FORMULARIOS PERO ME HACE FALTA MUCHO PERO QUIERO COMBINAR TODOS LOS ARCHIBOIS QUE TENGO Y NO SE SI ME PUEDE ALLUDAR

    ResponderEliminar