Sub FormatoCartaCarta()
'Selecciona todas las celda
Cells.Select
'Seleccionar fuente
With Selection.Font
.Name = "Calibri"
.Size = 11
End With
'Seleccionar alineacion ajustar al texto
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlTop
End With
'Aplicar formato texto a toda la hoja
Selection.NumberFormat = "@"
Range("A1").Select
With ActiveSheet.PageSetup
'Definimos encabezado izquierdo fecha y hora
.LeftHeader = "&D-&T"
'Definimos encabezado derecho página
.RightHeader = "Página &P de &N"
'Definimos margen superior
.TopMargin = Application.InchesToPoints(0.55)
'Definimos margen inferior
.BottomMargin = Application.InchesToPoints(0.75)
'Definimos margen izquierdo
.LeftMargin = Application.InchesToPoints(0.25)
'Definimos margen derecho
.RightMargin = Application.InchesToPoints(0.25)
'Definimos margen del encabezado
.HeaderMargin = Application.InchesToPoints(0.3)
'Definimos margen del pie de página
.FooterMargin = Application.InchesToPoints(0.3)
End With
'Seleccionamos de la fila 1 a la 9 y cambiamos alineacion sin justar
Rows("1:15").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlTop
End With
Columns("A:A").ColumnWidth = 0.5
Columns("B:B").ColumnWidth = 0.58
Columns("C:C").ColumnWidth = 14.14
Columns("D:D").ColumnWidth = 8.43
Columns("E:E").ColumnWidth = 41.71
Columns("F:F").ColumnWidth = 10.14
Columns("G:G").ColumnWidth = 4.71
Columns("H:H").ColumnWidth = 11.71
Rows("1:1").RowHeight = 8.25
'Combinar celdas
Range("B2:H2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
End With
Selection.Merge
Range("B3:H3").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
End With
Selection.Merge
Range("B4:H4").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
End With
Selection.Merge
Range("B5:H5").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
End With
Selection.Merge
Range("B6:H6").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
End With
Selection.Merge
Range("B7:H7").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
End With
Selection.Merge
'Formato empresa y rfc
Range("B2:H2").Select
With Selection.Font
.Name = "Tahoma"
.Size = 12
End With
Selection.Font.Bold = True
Range("B3:H3").Select
Selection.Font.Bold = True
With Selection.Font
.Name = "Calibri"
.Size = 12
End With
Selection.Font.Italic = True
'Colocar una autoforma
ActiveSheet.Shapes.AddShape(msoShapeRoundedRectangle, 4.5, 4.5, 503, 104.25).Select
Selection.ShapeRange.Fill.Visible = msoFalse
With Selection.ShapeRange.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 32, 96)
.Transparency = 0
End With
With Selection.ShapeRange.Line
.Visible = msoTrue
.Weight = 2.25
End With
ActiveSheet.Shapes.AddShape(msoShapeRoundedRectangle, 4.5, 113, 503, 80).Select
Selection.ShapeRange.Fill.Visible = msoFalse
With Selection.ShapeRange.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 32, 96)
.Transparency = 0
End With
With Selection.ShapeRange.Line
.Visible = msoTrue
.Weight = 2.25
End With
Rows("14:14").RowHeight = 9
ActiveSheet.Shapes.AddShape(msoShapeRoundedRectangle, 4.5, 198, 503, 16.75).Select
Selection.ShapeRange.Fill.Visible = msoFalse
With Selection.ShapeRange.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 32, 96)
.Transparency = 0
End With
With Selection.ShapeRange.Line
.Visible = msoTrue
.Weight = 2.25
End With
'Alineacion y fondo a titulo de partidas
Range("B15:H15").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
End With
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 49407
End With
'Formato partidas
Rows("16:10000").Select
With Selection.Font
.Name = "Calibri"
.Size = 10
End With
'Alineacion de precio,descuento,importe
Range("F16:F10000").Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlTop
End With
Range("G16:G10000").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
End With
Range("H16:H10000").Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlTop
End With
'Alto de fila
Rows("2:2").RowHeight = 15
Rows("3:3").RowHeight = 15.75
Rows("4:4").RowHeight = 15
Rows("5:5").RowHeight = 19.5
Rows("6:6").RowHeight = 19.5
Rows("7:7").RowHeight = 15
Rows("8:8").RowHeight = 8
'Tamaño de fuente a datos generales
Rows("9:13").Select
With Selection.Font
.Name = "Calibri"
.Size = 10
End With
[B2] = "EMPRESA INVALIDA SA DE CV"
[B3] = "RFC SACM831023CC0"
[B4] = "AVENIDA 2 OTE NO 1159 COL CENTRO HUATUSCO VERACRUZ MEXICO"
[B5] = "TELEFONO: 2731564470"
[B6] = "EMAIL: marioni1023@hotmail.com"
[C9] = "NOMBRE: LA ESPECIAL SA DE CV"
[C10] = "DIRECCION: AV 5 PTE NO,152 COL CENTRO OAXACA OAX"
[C11] = "FECHA Y HORA:23/10/2023-02:27:22 p.m."
[C12] = "CONDICIONES DE PAGO:CONTADO"
[C13] = "FORMA DE PAGO: TRASNSFERENCIA ELECTRONICA DE FONDOS"
[F9] = "NOTA DE VENTA"
[F10] = "SERIE Y FOLIO: A1000"
[F11] = "REFERENCIA:O.C.1764"
[F12] = "USUARIO:1.-admin"
[F13] = "ESTATUS:VIGENTE"
[C15] = "CODIGO"
[D15] = "CANTID"
[E15] = "DESCRIPCION"
[F15] = "PRECIO"
[G15] = "DESC"
[H15] = "IMPORTE"
Range("A1").Select
End Sub
No hay comentarios.:
Publicar un comentario