0% found this document useful (0 votes)
17 views7 pages

Sub TESTING

The document contains VBA code that formats cells and adds borders in an Excel worksheet for progress billing. The code defines multiple subroutines to format cells, add labels and values, calculate fields, and clear or delete data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views7 pages

Sub TESTING

The document contains VBA code that formats cells and adds borders in an Excel worksheet for progress billing. The code defines multiple subroutines to format cells, add labels and values, calculate fields, and clear or delete data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

Sub TESTING()

Range("q15").Style = "currency"
Range("q17").NumberFormat = "0%"
Range("m20:m39").NumberFormat = "0%"

End Sub

Sub BSCE1B_9()

Cells.ClearContents
Cells.ClearFormats
Cells.ColumnWidth = 8.11

Range("l12") = "Date:"
Range("l13") = "Project: Tup Student Center"
Range("l14") = "Location: Ermita,Manila"
Range("l15") = "Subject: Progress Billing"
Range("l16") = "Date Covered:"
Range("l17") = "Service Provider:BSCE"

Range("o12") = "Billing no.:"


Range("o13") = "IO no."
Range("o14") = "PO no."
Range("o15") = "Total Contract Amount:"
Range("o16") = "DP Amount"
Range("o17") = "Retention:"

Range("l19") = "Billing No."


Range("m19") = "% Accomplishments"
Range("n19") = "Gross Amount"
Range("o19") = "DP Recoupmnet"
Range("p19") = "Retention"
Range("q19") = "Net Amount"

Range("l20") = 1
Range("l21") = 2
Range("120:l21").Select
Selection.AutoFill Destination:=Range("l20:l39"), Type:=x1FillDefault

Range("m20") = "10%"
Range("m21") = "20%"
Range("m22") = "30%"
Range("m23") = "40%"

Range("l12:q17").Select

With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
End With

With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
End With

==================================
Sub BSCE1B_GRP9()

Range("n20") = "=m20*$q$15"
Range("n21") = "=m21*$q$15"
Range("n20:n21").Select
Selection.AutoFill Destination:=Range("n20:n39"), Type:=xlFillDefault

Range("o20") = "=m20*$q$16"
Range("o21") = "=m21*$q$16"
Range("o20:o21").Select
Selection.AutoFill Destination:=Range("o20:o39"), Type:=xlFillDefault

Range("p20") = "=n20*$q$17"
Range("p21") = "=n21*$q$17"
Range("p20:p21").Select
Selection.AutoFill Destination:=Range("p20:p39"), Type:=xlFillDefault

Range("q20") = "=n20-o20-p20"
Range("q21") = "=n21-o21-p21"
Range("q20:q21").Select
Selection.AutoFill Destination:=Range("q20:q39"), Type:=xlFillDefault

Range("n40") = "=SUM(n20:n39)"
Range("o40") = "=SUM(o20:o39)"
Range("p40") = "=SUM(p20:p39)"
Range("q40") = "=SUM(q20:q39)"

Range("l12") = "Date:"
Range("l13") = "Project: Tup Student Center"
Range("l14") = "Location: Ermita,Manila"
Range("l15") = "Subject: Progress Billing"
Range("l16") = "Date Covered:"
Range("l17") = "Service Provider:BSCE1B"

Range("o12") = "Billing no.:"


Range("o13") = "IO no."
Range("o14") = "PO no."
Range("o15") = "Total Contract Amount:"
Range("o16") = "DP Amount"
Range("o17") = "Retention:"

Range("l19") = "Billing No."


Range("m19") = "% Accomplishments"
Range("n19") = "Gross Amount"
Range("o19") = "DP Recoupmnet"
Range("p19") = "Retention"
Range("q19") = "Net Amount"

Range("l12:n17").Select
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
End With

Range("l12:q17").Select

With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThick
End With

With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThick
End With

With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThick
End With

With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThick
End With

Range("l19:q39").Select

With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThick
End With

With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThick
End With

With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThick
End With

With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThick
End With

With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
End With

With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
End With

'Merge Cells
Range("l18:q18").Select
Selection.MergeCells = True
Range("l18:q18") = "BILLING HISTORY"
Range("l18:q18").Font.Bold = True

Range("l18:q18").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With

Range("l18:q18").Select

With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThick
End With

With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThick
End With

With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThick
End With

With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThick
End With

Range("l20") = 1
Range("l21") = 2
Range("l20:l21").Select
Selection.AutoFill Destination:=Range("l20:l39"), Type:=x1FillDefault

Range("m20") = 0.1
Range("m21") = 0.2
Range("m20:m21").Select
Selection.AutoFill Destination:=Range("m20:m39"), Type:=xlFillDefault
Range("m20:m39").NumberFormat = "0%"

Range("q15") = "$18000000"
Range("q16") = "=0.3*q15"

Range("n20:n40").Style = "currency"
Range("q16").Style = "currency"
Range("o20:o40").Style = "currency"
Range("p20:p39").Style = "currency"
Range("q20").Style = "currency"
Range("q17") = "10%"

Range("m19").ColumnWidth = 25
Range("n19").ColumnWidth = 25
Range("o19").ColumnWidth = 25
Range("p19").ColumnWidth = 25
Range("q19").ColumnWidth = 25
Range("n20") = "=q15*m20"

Range("o20") = "=q16*m20"

Range("p20") = "=n20*q17"

Range("q20") = "=n20-o20-p20"

Range("l40") = "TOTAL"

Range("l42") = "PREPARED BY:"

Range("l45") = "GROUP9"
Range("l46") = "CANTUBA,CASSIEL ISIDORA C."
Range("l47") = "BULALACAO,CATHERIN D."
Range("l48") = "MAGCULANG,JESSICA O."

Range("O42") = "NOTED BY"


Range("o45") = "ENGR. JHON LOUIE CUERDO"

End Sub

Sub cleardata()

Range("l12") = "Date:"
Range("l13") = "Project:"
Range("l14") = "Location: "
Range("l15") = "Subject: "
Range("l16") = "Date Covered:"
Range("l17") = "Service Provider:"

Range("o12") = "Billing no.:"


Range("o13") = "IO no."
Range("o14") = "PO no."
Range("o15") = "Total Contract Amount:"
Range("o16") = "DP Amount"
Range("o17") = "Retention:"

Range("m20:m39") = ""
Range("q15") = ""
Range("q17") = ""

End Sub

Sub deleteall()

Cells.ClearContents
Cells.ClearFormats
Cells.ColumnWidth = 8.11

End Sub
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
End With

Range("l20") = 1
Range("121") = 2
Range("l20:l21").Select
Selection.AutoFill Destination:=Range("l20:l39"), Tyoe:=xlFillDefault

End Sub

Sub BSCE1B9()
'
''Merge Cells
'Range("l18:q18").Select
'Selection.MergeCells = True
'
'Range("l18:q18") = "BILLING HISTORY"

End Sub

------------------
Sub CLEARDATA()

Range("l12") = "Date:"
Range("l13") = "Project: Tup Student Center"
Range("l14") = "Location: Ermita,Manila"
Range("l15") = "Subject: Progress Billing"
Range("l16") = "Date Covered:"
Range("l17") = "Service Provider:BSCE"

Range("o12") = "Billing no.:"


Range("o13") = "IO no."
Range("o14") = "PO no."
Range("o15") = "Total Contract Amount:"
Range("o16") = "DP Amount"
Range("o17") = "Retention:"

Range("l19") = "Billing No."


Range("m19") = "% Accomplishments"
Range("n19") = "Gross Amount"
Range("o19") = "DP Recoupmnet"
Range("p19") = "Retention"
Range("q19") = "Net Amount"

Range("l12:q17").Select

With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
End With

With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
End With

With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
End With

End Sub

You might also like