Visual Basic - Subotales en Vb para Excel

Life is soft - evento anual de software empresarial
 
Vista:

Subotales en Vb para Excel

Publicado por JULIO (11 intervenciones) el 19/11/2001 07:13:10
Hola A todos:
Yo subtotalizo una hoja excel de esta manera en codigo VB.
Selection.Subtotal GroupBy:=1, Function:=xlSum, _
TotalList:=Array(13, 14, 16, 17, 19, _
20, 22, 23, 25, 26, 28, 29, _
31, 32, 34, 35, 37, 38, 40, 41, _
43, 44, 46, 47, 48, 49), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
Pero ahora yo tengo que crear el arreglo que varia el incio y el fin de este.
Que es el que paso en TotalList:=, bueno cree dos funciones de prueba pero tengo problemas al pasar el valor del arregloen ToatlList.
las funciones son :
Function ConstruyeArray(Arrayini As Integer)
Dim cad As Variant
num = Arrayini
For x = 0 To 160
If x <> 160 Then
cad = cad & Str(num) & ","
Else
cad = cad & Str(num)
End If
num = num + 1
Next x
ConstruyeArray = cad
End Function
Function ConstruyeArray2(Arrayini As Integer)
Dim cad(160) As Currency
num = Arrayini
For x = 0 To 160
cad(x) = num
num = num + 1
Next x
ConstruyeArray2 = cad()
End Function

Como paso el arreglo, Gracias de Antemano
Selection.Subtotal GroupBy:=1, Function:=xlSum, _
TotalList:="QUE PONGO ACA", _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder