Ir ao conteúdo
  • Cadastre-se

ACERTAR PLANILHA - nao soma algumas linhas


ferrubim

Posts recomendados

segue macro:

Sub DINAMICA()

'

' DINAMICA Macro

' Macro gravada em 11/05/2010 por NOVO

'

'

Application.Goto Reference:="DADOS"

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:="DADOS") _

.CreatePivotTable TableDestination:="", TableName:="Tabela dinâmica2", _

DefaultVersion:=xlPivotTableVersion10

ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)

ActiveSheet.Cells(3, 1).Select

ActiveSheet.PivotTables("Tabela dinâmica2").NullString = "---"

ActiveSheet.PivotTables("Tabela dinâmica2").AddFields RowFields:=Array( _

"CONTA", "SUBCONTA"), ColumnFields:=Array("UF", "FILIAL"), PageFields:="DATA"

With ActiveSheet.PivotTables("Tabela dinâmica2").PivotFields("VALOR POS_NEG")

.Orientation = xlDataField

.Caption = "Despesas"

.Function = xlSum

.NumberFormat = "#,###,###,##0.00"

End With

ActiveWorkbook.ShowPivotTableFieldList = True

ActiveWorkbook.ShowPivotTableFieldList = False

ActiveSheet.PivotTables("Tabela dinâmica2").PivotSelect "", xlDataAndLabel, _

True

ActiveSheet.PivotTables("Tabela dinâmica2").Format xlTable8

Application.CommandBars("PivotTable").Visible = False

Cells.Select

With Selection.Font

.Name = "Arial"

.Size = 8

.Strikethrough = False

.Superscript = False

.Subscript = False

.OutlineFont = False

.Shadow = False

.Underline = xlUnderlineStyleNone

End With

Cells.EntireColumn.AutoFit

Columns("Q:R").Hidden = True

Range("A1").Select

End Sub

Link para o comentário
Compartilhar em outros sites

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...

Ebook grátis: Aprenda a ler resistores e capacitores!

EBOOK GRÁTIS!

CLIQUE AQUI E BAIXE AGORA MESMO!