0% found this document useful (0 votes)
67 views15 pages

Sub Num - Prot

The document contains multiple VBA macros that format and populate data across multiple worksheets. The macros: 1) insert values and text into cells on worksheets 5 to 125; 2) insert a header and names into cells; 3) insert temperatures into cells; 4) insert an "X" and blank value into cells on worksheets 5 to 39; 5) center align cells and apply formatting; 6) insert a column on worksheets 6 to 14; 7) apply borders and formatting to ranges; 8) insert blank cells and lines for signatures; 9) insert and resize images into cells; 10) copy and image from one worksheet to another; 11) insert and resize new images into multiple worksheets; and 12)
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views15 pages

Sub Num - Prot

The document contains multiple VBA macros that format and populate data across multiple worksheets. The macros: 1) insert values and text into cells on worksheets 5 to 125; 2) insert a header and names into cells; 3) insert temperatures into cells; 4) insert an "X" and blank value into cells on worksheets 5 to 39; 5) center align cells and apply formatting; 6) insert a column on worksheets 6 to 14; 7) apply borders and formatting to ranges; 8) insert blank cells and lines for signatures; 9) insert and resize images into cells; 10) copy and image from one worksheet to another; 11) insert and resize new images into multiple worksheets; and 12)
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Sub Num_prot()

Dim h As Integer
Dim Num_prot As Integer
Num_prot = 459
For h = 5 To 125
If h = 55 Then
h=h+1
End If
If h = 91 Then
h=h+1
End If

Worksheets(h).Cells(5, 11) = Num_prot


Num_prot = Num_prot + 1
Next h
End Sub

Sub Tec_corpac()
Dim h As Integer

Dim tec_corp As String


tec_corp = "TECNICO CORPAC:"
For h = 5 To 125
Worksheets(h).Cells(11, 9) = tec_corp
Next h
End Sub

Sub Nom_tec()
Dim h As Integer
For h = 5 To 125
Worksheets(h).Cells(11, 11) = "IVAN TALAVERA"
Worksheets(h).Cells(12, 11) = "FELIZ GONZALES"
Worksheets(h).Cells(13, 11) = "PERCY CASTRO"
Next h
End Sub

Sub Temp()

Dim h As Integer
For h = 5 To 123
Worksheets(h).Cells(21, 13) = "16-20 C"
Next h
End Sub

Sub Suelo_S_H()
Dim h As Integer
For h = 5 To 39
Worksheets(h).Cells(23, 13) = "X"
Worksheets(h).Cells(25, 13) = " "

Next h
End Sub

Sub Centrar()
Dim h As Integer
For h = 5 To 55
Worksheets(h).Select

Range("M23").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Next h
End Sub

Sub Insert_col()

Dim h As Integer
For h = 6 To 14
Worksheets(h).Select
Columns("A:A").Select
Selection.Insert Shift:=xlToRight,
CopyOrigin:=xlFormatFromLeftOrAbove
Range("C4").Select
Next h
End Sub

Sub Agrandar_marco()
Dim h As Integer
For h = 6 To 14
Worksheets(h).Select
Range("B1:O64").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)

.LineStyle = xlDouble
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThick
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDouble
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThick
End With
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
With Selection.Borders(xlEdgeRight)
.LineStyle = xlDouble
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThick
End With
Range("B1:O72").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlDouble
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThick

End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDouble
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThick
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThick
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlDouble
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThick
End With
Range("A1").Select
Next h
End Sub

Sub Insert_col()

Dim h As Integer
For h = 5 To 14
Worksheets(h).Select
Columns("A:A").Select
Selection.Insert Shift:=xlToRight,
CopyOrigin:=xlFormatFromLeftOrAbove
Range("C4").Select
Next h
End Sub

Sub Agrandar_marco()
Dim h As Integer
For h = 5 To 14
Worksheets(h).Select
Range("B1:O64").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlDouble

.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThick
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDouble
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThick
End With
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
With Selection.Borders(xlEdgeRight)
.LineStyle = xlDouble
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThick
End With
Range("B1:O72").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlDouble
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThick
End With

With Selection.Borders(xlEdgeTop)
.LineStyle = xlDouble
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThick
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThick
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlDouble
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThick
End With
Range("A1").Select
Next h
End Sub

Sub Nom_firmas()

Dim h As Integer
For h = 5 To 14
Worksheets(h).Cells(63, 3) = " "
Worksheets(h).Cells(63, 7) = " "
Worksheets(h).Cells(63, 11) = " "
Worksheets(h).Cells(68, 3) =
"__________________________________"
Worksheets(h).Cells(68, 7) =
"__________________________________"
Worksheets(h).Cells(68, 11) = "_________________________"
Worksheets(h).Cells(69, 3) = "CONSORCIO SOLUCIONES NET
DATA SAC"
Worksheets(h).Cells(69, 7) = "CONSORCIO SOLUCIONES NET
DATA SAC"
Worksheets(h).Cells(69, 11) = "

CORPAC"

Worksheets(h).Cells(70, 3) = "
SRL"

C&T INDUSTRIAL

Worksheets(h).Cells(70, 7) = "
SRL"

C&T INDUSTRIAL

Worksheets(h).Cells(71, 4) = " VoBo G.G."


Next h
End Sub

Sub Logo_corpac()

Dim h As Integer
For h = 5 To 14
Worksheets(h).Select
Range("C2").Select
ActiveSheet.Pictures.Insert("C:\Users\niko\Desktop\2.jpg").Select
Selection.ShapeRange.ScaleWidth 0.54, msoFalse,
msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.54, msoFalse,
msoScaleFromTopLeft
Range("L2").Select
ActiveSheet.Pictures.Insert("C:\Users\niko\Desktop\1.jpg").Select
Selection.ShapeRange.ScaleWidth 0.54, msoFalse,
msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.54, msoFalse,
msoScaleFromTopLeft
Range("G12").Select
Next h
End Sub

Sub Copiar_Img_celda_Pegar()

Worksheets(1).Select
Cells(8, 7).Select
Selection.Copy
Worksheets(5).Select
Cells(10, 18).Select
ActiveSheet.Paste
End Sub

Sub Nuevo_Logo_corpac()
Dim h As Integer
Dim Fotos As Object
Dim ruta1 As String
Dim ruta2 As String

ruta1 = "C:\Users\niko\Desktop\1.jpg"
ruta2 = "C:\Users\niko\Desktop\2.jpg"
for h = 5 to 50
Worksheets(h).Select
Range("C2").Select
Set Fotos = ActiveSheet.Shapes.AddPicture(Filename:=ruta2,
_
linktofile:=msoFalse, savewithdocument:=msoCTrue, _
Left:=0, Top:=0, Width:=-1, Height:=-1)

Set r1 = Cells(2, "C")


r1.Select
With Fotos
.Top = r1.Top
.Width = .Width / 1.5
.Height = .Height / 1.5
.Left = r1.Left
r1.EntireRow.RowHeight = .Height
.Placement = xlMoveAndSize
End With

Range("K2").Select
Set Fotos = ActiveSheet.Shapes.AddPicture(Filename:=ruta1,
_
linktofile:=msoFalse, savewithdocument:=msoCTrue, _
Left:=0, Top:=0, Width:=-1, Height:=-1)
Set r1 = Cells(2, "K")
r1.Select
With Fotos
.Top = r1.Top
.Width = .Width / 1.5
.Height = .Height / 1.5
.Left = r1.Left

r1.EntireRow.RowHeight = .Height
.Placement = xlMoveAndSize
End With
Range("G12").Select
Next h
End Sub

Sub Borra_imagenes()
Dim h As Integer
For h = 5 To 32
Worksheets(h).Select
ActiveSheet.Pictures.Select
Selection.Delete
Next h
End Sub

You might also like