Eu gerei mais uma macro GerarSaldo
ela copia saldo atual e cola na anterior
antes de zerar as outras planilhas
ficou uma macro copiar e colar mas resolveu
aguardo nova ideias
Sub Macro1()
Sheets("Produtos").Select
GerarSaldo
Sheets("Compras").Select
Range("A2").Select
Application.CutCopyMode = False
Do While ActiveCell <> ""
ActiveCell.Offset(1, 0).Select
Range(ActiveCell, ActiveCell.End(xlToRight)).Copy Destination:= _
Sheets("TComp").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
Loop
Sheets("Vendas").Select
Range("A2").Select
Application.CutCopyMode = False
Do While ActiveCell <> ""
ActiveCell.Offset(1, 0).Select
Range(ActiveCell, ActiveCell.End(xlToRight)).Copy Destination:= _
Sheets("TSaid").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
Loop
Sheets("Compras").Select
Range("A2").Select
ActiveCell.Offset(1, 0).Select
Do While ActiveCell <> ""
Range(ActiveCell, ActiveCell.End(xlToRight)).Delete Shift:=xlUp
Loop
Sheets("Vendas").Select
Range("A2").Select
ActiveCell.Offset(1, 0).Select
Do While ActiveCell <> ""
Range(ActiveCell, ActiveCell.End(xlToRight)).Delete Shift:=xlUp
Loop
End Sub
Sub GerarSaldo()
' GerarSaldo Macro
Columns("F:F").Select
Selection.Copy
Columns("C:C").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C2").Select
ActiveCell.FormulaR1C1 = "Anterior"
Range("G1").Select
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 06/07/2011 7:52 am