You are on page 1of 2

Sub SumasySaldos()

Application.ScreenUpdating = False
Sheets("SUMAS Y SALDOS").Select
Range("A11:G1000").Select
Selection.Clear
Selection.Font.Bold = False
Range("B10:C23").Select
Selection.ClearContents

Sheets("DIARIO").Select
Range("A1").Select
Range("tablaLibroDiario[[C�DIGO]:[CUENTA]]").Copy

Sheets("SUMAS Y SALDOS").Select
Range("B10").Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
'QUITAR DUPLICADOS
ActiveSheet.Range("B10:C10000").RemoveDuplicates Columns:=Array(1, 2)

FILA_MARGEN = Range("C1048576").End(xlUp).Row
Range("B8", Cells(FILA_MARGEN + 1, 7)).Select
'PONER MARGEN A LO SELECCINADO
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With

Range("D10:G10").Select
Selection.AutoFill Destination:=Range("D10", Cells(FILA_MARGEN, 7)),
Type:=xlFillDefault
Range("D10:G10").Select

Cells(FILA_MARGEN + 1, 3).Value = "SUMAS IGUALES"


Range("C1048576").End(xlUp).Select
UF = ActiveCell.Row
ActiveCell.Offset(0, 1).Select
Selection.Formula = "=sum(D10:D" & UF - 1 & ")"
ActiveCell.Copy
Range(Cells(UF, 4), Cells(UF, 7)).Select
Selection.PasteSpecial Paste:=xlPasteFormulas
Application.CutCopyMode = False
'NEGRITA.........
Range(Cells(UF, 1), Cells(UF, 7)).Select
Selection.Font.Bold = True

Range("A1").Select

Application.ScreenUpdating = True
End Sub

You might also like