Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
#45923
Desculpa pessoal..

Marquei o tópico como resolvido antes de dar a solução e agradecer os usuário oswaldomp

Segue abaixo:

________________________________
Valeu Oswaldo.

A partir da sua dica resolvi como eu de fato queria.

Fiz até de outras maneiras, porém ou elas eram extremamente trabalhosas ou não traziam a fórmula onde eu queria. Segue abaixo:
##################################
Sub SomaSe_condicional()
' Verificar qual a ultima linha da coluna "A"; Aplicar SOMASE

Dim ultimalinha As Long
ultimalinha = Range("A" & Rows.Count).End(xlUp).Row
Dim Int1 As Range
Dim Int2 As Range
Dim Int3 As Range
Set Int1 = Worksheets(1).Range("A5:" & "A" & ultimalinha)
Set Int2 = Worksheets(1).Range("B5:" & "B" & ultimalinha)
Set Int3 = Worksheets(1).Range("a2")
Range("B1").FormulaR1C1 = "=SUMIF(R5C1:R[" & Last - 1 & "]C1,RC[-1],R5C2:R[" & Last - 1 & "]C2)"
Range("B2") = WorksheetFunction.SumIf(Int1, Int3, Int2)
Range("B3").Formula = "=SUMIF(A5:A" & ultimalinha & ",A3, B5:B" & ultimalinha & ")"

' Dica osvaldomp
'Range("D1:D3").Formula = "=SUMIF(A$5:A$" & ultimalinha & ",A1,B$5:B$" & ultimalinha & ")"

End Sub
#######################
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord