Subtotal en Columnas

UliCs

New Member
Joined
Oct 20, 2009
Messages
36
Hola amigos.
necesito de su ayuda nuevamente.
como puedo usar la formula de subtotales en columnas. es decir cuando pongo la formula en con referencia a un rango de filas al ocultar algunas filas me da el valor de las filas visibles, pero en columnas no puedo hacer eso. Existe alguna otra forma de hacerlo.

Ayudenme.:ROFLMAO:
<div_prefs id="div_prefs"></div_prefs>
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Code:
Function SumVisibles(rng As Range) As Double
Dim celRng As Range
Dim suma As Double

'Application.Volatile Resulta ineficaz, ya que ocultar o Mostrar no desencadenan Calculation
For Each celRng In rng.Cells
If Not (celRng.EntireColumn.Hidden) Then suma = suma + Val(celRng)

Next celRng
SumVisibles = suma
End Function

algo basico y sin testeo
 
Upvote 0
Gali.
una pregunta mas.
ahora como puedo hacer que esta formula este calculando en el momemto. sin tener que calcular manual para que de el valor.

Saludos!
 
Upvote 0
Mientras lo que dice Gali es 100 por ciento cierto, uno podría hacer unas cosillas creativas como enganchar el evento de cambio de selección para ver si alguna visibidad ha cambiado y correr el método de calcular si sí algo cambió. Mientras no está ocultando columnas por medio de VBA, debe de funcionar bastante bien, me imagino.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
 
    Static s_strColVisibilities As String
 
    Dim rngCell As Excel.Range, strColVisibilities As String
 
    For Each rngCell In Me.UsedRange.Rows(1).Cells
        Let strColVisibilities = strColVisibilities & CStr(rngCell.EntireColumn.Hidden)
    Next rngCell
 
    If strColVisibilities <> s_strColVisibilities Then
        Me.Calculate
        Let s_strColVisibilities = strColVisibilities
    End If
 
End Sub

Note Bien: tendrá que cambiar la función de sumar visibles para que sea VOLATILE.
 
Last edited:
Upvote 0
Muchas pero muchas Gracias Greg.
Funciono a la perfeccion!!!

Gali de igual manera gracias.

-saludos y felices fiestas
 
Upvote 0

Forum statistics

Threads
1,214,590
Messages
6,120,423
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top