Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Sub grabar_factura()

'

' grabar_factura Macro

'

'

Sheets("VENTAS").Select

Rows("7:7").Select

Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

Selection.RowHeight = 15

Range("Tabla_ventas").Select

With Selection.Interior

.Pattern = xlNone

.TintAndShade = 0

.PatternTintAndShade = 0

End With

With Selection.Font

.ColorIndex = xlAutomatic

.TintAndShade = 0

End With

Selection.Font.Bold = True

Selection.Font.Bold = False

With Selection

.HorizontalAlignment = xlCenter

.VerticalAlignment = xlBottom

.WrapText = True

.Orientation = 0

.AddIndent = False

.IndentLevel = 0

.ShrinkToFit = False

.ReadingOrder = xlContext
.MergeCells = False

End With

With Selection

.HorizontalAlignment = xlCenter

.VerticalAlignment = xlCenter

.WrapText = True

.Orientation = 0

.AddIndent = False

.IndentLevel = 0

.ShrinkToFit = False

.ReadingOrder = xlContext

.MergeCells = False

End With

With Selection

.HorizontalAlignment = xlGeneral

.VerticalAlignment = xlCenter

.WrapText = True

.Orientation = 0

.AddIndent = False

.IndentLevel = 0

.ShrinkToFit = False

.ReadingOrder = xlContext

.MergeCells = False

End With

With Selection

.HorizontalAlignment = xlCenter

.VerticalAlignment = xlCenter

.WrapText = True

.Orientation = 0

.AddIndent = False

.IndentLevel = 0
.ShrinkToFit = False

.ReadingOrder = xlContext

.MergeCells = False

End With

Range("Tabla_ventas[FECHA]").Select

Selection.NumberFormat = "m/d/yyyy"

Range("Tabla_ventas[[PRECIO DE COMPRA]:[TOTAL VENTA]]").Select

Selection.NumberFormat = "$ #,##0.00"

Sheets("FACTURACION").Select

Range("F3").Select

Selection.Copy

Sheets("VENTAS").Select

Range("Tabla_ventas[CODIGO CLIENTE]").Select

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _

:=False, Transpose:=False

Sheets("FACTURACION").Select

Range("F4").Select

Application.CutCopyMode = False

Selection.Copy

Sheets("VENTAS").Select

Range("Tabla_ventas[CODIGO FACTURA]").Select

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _

:=False, Transpose:=False

Sheets("FACTURACION").Select

Range("F7").Select

Application.CutCopyMode = False

Selection.Copy

Sheets("VENTAS").Select

Range("Tabla_ventas[FECHA]").Select

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _

:=False, Transpose:=False
Sheets("FACTURACION").Select

Range("Tabla_factura[CODIGO]").Select

Application.CutCopyMode = False

Selection.Copy

Sheets("VENTAS").Select

Range("Tabla_ventas[CODIGO PRODUCTO]").Select

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _

:=False, Transpose:=False

Sheets("FACTURACION").Select

Range("Tabla_factura[PRODUCTO]").Select

Application.CutCopyMode = False

Selection.Copy

Sheets("VENTAS").Select

Range("Tabla_ventas[PRODUCTO]").Select

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _

:=False, Transpose:=False

Sheets("FACTURACION").Select

Range("Tabla_factura[CANTIDAD]").Select

Application.CutCopyMode = False

Selection.Copy

Sheets("VENTAS").Select

Range("Tabla_ventas[CANTIDAD]").Select

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _

:=False, Transpose:=False

Sheets("FACTURACION").Select

Range("Tabla_factura[PRECIO DE VENTA]").Select

Application.CutCopyMode = False

Selection.Copy

Sheets("VENTAS").Select

Range("Tabla_ventas[PRECIO DE VENTA]").Select

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _


:=False, Transpose:=False

Sheets("FACTURACION").Select

Range("Total_factura").Select

Application.CutCopyMode = False

Selection.Copy

Sheets("VENTAS").Select

Range("Tabla_ventas[TOTAL VENTA]").Select

Application.CutCopyMode = False

Sheets("VENTAS").Select

Range("Tabla_ventas[CODIGO FACTURA]").Select

ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="Facturas%20PDF", _

TextToDisplay:="QUI - 43178"

Sheets("FACTURACION").Select

End Sub

You might also like