Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

698
Visualizações
Excel VBA/C# Subtotal Function: What does TotalList parameter do?

I'm trying to get the subtotals for a table in C# using Microsoft.Interop.Excel, and there is a built in function for that.

[Here][1] is the link to the documentation for the Subtotal function.

I understand what GroupBy and Function parameters do, but what exactly is the TotalList parameter for? Microsoft describes it as:

"An array of 1-based field offsets, indicating the fields to which the subtotals are added."

How are these offsets being read? In pairs for row and column offset? In examples I see whole arrays of many numbers being used for this. How do I make use of this? [1]: https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.excel.range.subtotal?view=excel-pia

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You pass an array of as many numbers as you have columns for which you want subtotals calculated. If you only have one column to subtotal, you can just pass in a single number in place of an array (at least, in VBA that works)

Eg: (in VBA) -

Range("A1").CurrentRegion.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(3, 5)

would group a table of data starting in A1, according to the first column, and add subtotals in the third and fifth columns.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda