Nav apraksta
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

合約請款單.vb 231KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210
  1. Imports Microsoft.Office.Interop.Excel.XlUnderlineStyle
  2. Imports Microsoft.Office.Interop.Excel.Constants
  3. Imports Microsoft.Office.Interop.Excel.XlBordersIndex
  4. Imports Microsoft.Office.Interop.Excel.XlLineStyle
  5. Imports Microsoft.Office.Interop.Excel.XlBorderWeight
  6. Imports Microsoft.Office.Interop.Excel.XlThemeFont
  7. Imports Microsoft.Office.Interop.Excel.XlThemeColor
  8. Imports Microsoft.Office.Interop.Excel.XlWindowState
  9. Imports Microsoft.Office.Interop.Excel
  10. Imports PdfSharp.Pdf
  11. Imports PdfSharp.Pdf.IO
  12. Imports System.IO
  13. Public Class 合約請款單
  14. ReadOnly ds1, ds2, ds6, ds7, ds8, ds9, ds10, ds11, ds15 As New DataSet
  15. Dim ESTR, 對話框(1) As String
  16. Dim EDR, 選擇項, DF, FG, GH As Integer
  17. Dim xlApp As Application : Dim xlBook As Workbook : Dim xlSheet As Worksheet
  18. Dim OldX, OldY As Long
  19. Dim drag, 放大 As Boolean
  20. Private Sub Set_合約清單()
  21. 合約_dgv.DataSource = Nothing : ds6.Clear()
  22. 合約_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  23. 合約_dgv.ColumnHeadersHeight = 25 : 合約_dgv.AllowUserToAddRows = False
  24. PA46 = 合約編號1_cb.Text : PA47 = 工程期1_ch.Text : PA = 關鍵字搜尋_tb.Text
  25. SQL_合約清單_請款用()
  26. da.Fill(ds6) : 合約_dgv.DataSource = ds6.Tables(0) : conn.Close()
  27. 合約_dgv.Columns(0).FillWeight = 160 : 合約_dgv.Columns(1).Visible = False : 合約_dgv.Columns(2).Visible = False : 合約_dgv.Columns(3).Visible = False
  28. 合約_dgv.Columns(4).Visible = False : 合約_dgv.Columns(5).Visible = False : 合約_dgv.Columns(6).Visible = False : 合約_dgv.Columns(7).Visible = False
  29. 合約_dgv.Columns(8).Visible = False : 合約_dgv.Columns(9).Visible = False : 合約_dgv.Columns(10).Visible = False : 合約_dgv.Columns(11).Visible = False
  30. 合約_dgv.Columns(12).Visible = False : 合約_dgv.Columns(13).Visible = False : 合約_dgv.Columns(14).Visible = False : 合約_dgv.Columns(15).Visible = False
  31. 合約_dgv.Columns(16).Visible = False : 合約_dgv.Columns(17).Visible = False : 合約_dgv.Columns(18).Visible = False : 合約_dgv.Columns(19).Visible = False
  32. 合約_dgv.Columns(20).Visible = False : 合約_dgv.Columns(21).Visible = False : 合約_dgv.Columns(22).Visible = False : 合約_dgv.Columns(23).Visible = False
  33. 合約_dgv.Columns(24).FillWeight = 100 : 合約_dgv.Columns(25).Visible = False : 合約_dgv.Columns(26).Visible = False : 合約_dgv.Columns(27).Visible = False
  34. 合約_dgv.Columns(28).Visible = False : 合約_dgv.Columns(29).Visible = False : 合約_dgv.Columns(30).Visible = False : 合約_dgv.Columns(表頭(2)).FillWeight = 300
  35. If 放大 = True Then
  36. 合約_dgv.Columns(表頭(2)).Visible = True
  37. Else
  38. 合約_dgv.Columns(表頭(2)).Visible = False
  39. End If
  40. End Sub
  41. Private Sub Set_附錄清單()
  42. 合約附錄_dgv.DataSource = Nothing : ds1.Clear()
  43. 合約附錄_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  44. 合約附錄_dgv.ColumnHeadersHeight = 25 : 合約附錄_dgv.AllowUserToAddRows = False
  45. SQL_附錄合約_清單查詢1()
  46. da.Fill(ds1) : 合約附錄_dgv.DataSource = ds1.Tables(0) : conn.Close()
  47. 合約附錄_dgv.Columns(0).Visible = False : 合約附錄_dgv.Columns(1).FillWeight = 160 : 合約附錄_dgv.Columns(2).Visible = False : 合約附錄_dgv.Columns(3).Visible = False
  48. 合約附錄_dgv.Columns(4).Visible = False : 合約附錄_dgv.Columns(5).Visible = False : 合約附錄_dgv.Columns(6).Visible = False : 合約附錄_dgv.Columns(7).FillWeight = 70
  49. End Sub
  50. Private Sub Set_合約報價總表()
  51. 報價總表_dgv.DataSource = Nothing : ds15.Clear()
  52. 報價總表_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  53. 報價總表_dgv.ColumnHeadersHeight = 40 : 報價總表_dgv.AllowUserToAddRows = False : 報價總表_dgv.RowTemplate.Height = 45
  54. 報價總表_dgv.RowsDefaultCellStyle.WrapMode = DataGridViewTriState.True
  55. SQL_合約報價總表()
  56. da.Fill(ds15) : 報價總表_dgv.DataSource = ds15.Tables(0) : conn.Close()
  57. 報價總表_dgv.Columns(0).Visible = False : 報價總表_dgv.Columns(8).Visible = False : 報價總表_dgv.Columns(9).Visible = False
  58. 報價總表_dgv.Columns(0).FillWeight = 50 : 報價總表_dgv.Columns(1).FillWeight = 50 : 報價總表_dgv.Columns(2).FillWeight = 210
  59. 報價總表_dgv.Columns(3).FillWeight = 50 : 報價總表_dgv.Columns(4).FillWeight = 50 : 報價總表_dgv.Columns(5).FillWeight = 80
  60. 報價總表_dgv.Columns(6).FillWeight = 80 : 報價總表_dgv.Columns(7).FillWeight = 90
  61. For i As Integer = 4 To 6 : 報價總表_dgv.Columns(i).DefaultCellStyle.Format = "#,##0" : Next
  62. For i As Integer = 4 To 6 : 報價總表_dgv.Columns(i).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : Next
  63. For i As Integer = 0 To 7 : 報價總表_dgv.Columns(i).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter : Next
  64. 報價總表_dgv.Columns(1).ReadOnly = True : 報價總表_dgv.Columns(2).ReadOnly = True : 報價總表_dgv.Columns(6).ReadOnly = True
  65. 報價總表_dgv.EditMode = DataGridViewEditMode.EditOnEnter
  66. End Sub
  67. Private Sub Set_請款清單()
  68. 請款單_dgv.DataSource = Nothing : ds2.Clear()
  69. 請款單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  70. 請款單_dgv.ColumnHeadersHeight = 25 : 請款單_dgv.AllowUserToAddRows = False
  71. SQL_請款單_清單查詢()
  72. da.Fill(ds2) : 請款單_dgv.DataSource = ds2.Tables(0) : conn.Close()
  73. 請款單_dgv.Columns(0).Visible = False : 請款單_dgv.Columns(1).FillWeight = 50 : 請款單_dgv.Columns(2).Visible = False : 請款單_dgv.Columns(3).FillWeight = 50
  74. 請款單_dgv.Columns(4).FillWeight = 100 : 請款單_dgv.Columns(5).FillWeight = 50 : 請款單_dgv.Columns(6).Visible = False : 請款單_dgv.Columns(7).Visible = False
  75. 請款單_dgv.Columns(8).FillWeight = 100 : 請款單_dgv.Columns(9).FillWeight = 80 : 請款單_dgv.Columns(10).FillWeight = 50
  76. 請款單_dgv.Columns(3).DefaultCellStyle.Format = "#,##0" : 請款單_dgv.Columns(4).DefaultCellStyle.Format = "#,##0"
  77. 請款單_dgv.Columns(5).DefaultCellStyle.Format = "#,##0" : 請款單_dgv.Columns(8).DefaultCellStyle.Format = "#,##0"
  78. 請款單_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  79. 請款單_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  80. 請款單_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  81. 請款單_dgv.Columns(8).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  82. If 請款單_dgv.Rows.Count = 0 Then : Label47.Text = "" : Else
  83. For i As Integer = 0 To 請款單_dgv.Rows.Count - 1
  84. If i = 請款單_dgv.Rows.Count - 1 Or i = 0 Then : Else
  85. If 請款單_dgv(表頭(6), i).Value.ToString() = 請款單_dgv(表頭(6), i + 1).Value.ToString() Then : Label47.Text = 對話框(1) : Set_請款清單_1() : Exit Sub : End If
  86. End If : Label47.Text = 對話框(0)
  87. Next
  88. End If : Set_請款清單_1
  89. End Sub
  90. Private Sub Set_請款清單_1()
  91. If Label47.Text = 對話框(1) Then : For i As Integer = 0 To 請款單_dgv.Rows.Count - 1 : 請款單_dgv("分期", i).Value = i + 1 : Next : End If
  92. End Sub
  93. Private Sub Set_合約明細1()
  94. 第1期_dgv.DataSource = Nothing : ds7.Clear()
  95. 第1期_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  96. 第1期_dgv.ColumnHeadersHeight = 25 : 第1期_dgv.AllowUserToAddRows = False
  97. SQL_合約明細讀取()
  98. da.Fill(ds7) : 第1期_dgv.DataSource = ds7.Tables(0) : conn.Close()
  99. 第1期_dgv.Columns(0).Visible = False : 第1期_dgv.Columns(1).Visible = False : 第1期_dgv.Columns(2).FillWeight = 20 : 第1期_dgv.Columns(3).FillWeight = 140
  100. 第1期_dgv.Columns(4).FillWeight = 20 : 第1期_dgv.Columns(5).FillWeight = 50
  101. 第1期_dgv.Columns(2).ReadOnly = True : 第1期_dgv.Columns(5).ReadOnly = True
  102. 第1期_dgv.EditMode = DataGridViewEditMode.EditOnEnter
  103. 第1期_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : 第1期_dgv.Columns(4).DefaultCellStyle.Format = "#,##0.00" : 第1期_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
  104. 第1期_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 第1期_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  105. End Sub
  106. Private Sub Set_合約明細2()
  107. 第2期_dgv.DataSource = Nothing : ds8.Clear()
  108. 第2期_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  109. 第2期_dgv.ColumnHeadersHeight = 25 : 第2期_dgv.AllowUserToAddRows = False
  110. SQL_合約明細讀取()
  111. da.Fill(ds8) : 第2期_dgv.DataSource = ds8.Tables(0) : conn.Close()
  112. 第2期_dgv.Columns(0).Visible = False : 第2期_dgv.Columns(1).Visible = False : 第2期_dgv.Columns(2).FillWeight = 20 : 第2期_dgv.Columns(3).FillWeight = 140
  113. 第2期_dgv.Columns(4).FillWeight = 20 : 第2期_dgv.Columns(5).FillWeight = 50
  114. 第2期_dgv.Columns(2).ReadOnly = True : 第2期_dgv.Columns(5).ReadOnly = True
  115. 第2期_dgv.EditMode = DataGridViewEditMode.EditOnEnter
  116. 第2期_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : 第2期_dgv.Columns(4).DefaultCellStyle.Format = "#,##0.00" : 第2期_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
  117. 第2期_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 第2期_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  118. End Sub
  119. Private Sub Set_合約明細3()
  120. 第3期_dgv.DataSource = Nothing : ds9.Clear()
  121. 第3期_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  122. 第3期_dgv.ColumnHeadersHeight = 25
  123. 第3期_dgv.AllowUserToAddRows = False
  124. SQL_合約明細讀取()
  125. da.Fill(ds9) : 第3期_dgv.DataSource = ds9.Tables(0) : conn.Close()
  126. 第3期_dgv.Columns(0).Visible = False : 第3期_dgv.Columns(1).Visible = False : 第3期_dgv.Columns(2).FillWeight = 20 : 第3期_dgv.Columns(3).FillWeight = 140
  127. 第3期_dgv.Columns(4).FillWeight = 20 : 第3期_dgv.Columns(5).FillWeight = 50
  128. 第3期_dgv.Columns(2).ReadOnly = True : 第3期_dgv.Columns(5).ReadOnly = True
  129. 第3期_dgv.EditMode = DataGridViewEditMode.EditOnEnter
  130. 第3期_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : 第3期_dgv.Columns(4).DefaultCellStyle.Format = "#,##0.00" : 第3期_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
  131. 第3期_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 第3期_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  132. End Sub
  133. Private Sub Set_合約明細4()
  134. 第4期_dgv.DataSource = Nothing : ds10.Clear()
  135. 第4期_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  136. 第4期_dgv.ColumnHeadersHeight = 25 : 第4期_dgv.AllowUserToAddRows = False
  137. SQL_合約明細讀取()
  138. da.Fill(ds10) : 第4期_dgv.DataSource = ds10.Tables(0) : conn.Close()
  139. 第4期_dgv.Columns(0).Visible = False : 第4期_dgv.Columns(1).Visible = False : 第4期_dgv.Columns(2).FillWeight = 20 : 第4期_dgv.Columns(3).FillWeight = 140
  140. 第4期_dgv.Columns(4).FillWeight = 20 : 第4期_dgv.Columns(5).FillWeight = 50
  141. 第4期_dgv.Columns(2).ReadOnly = True : 第4期_dgv.Columns(5).ReadOnly = True
  142. 第4期_dgv.EditMode = DataGridViewEditMode.EditOnEnter
  143. 第4期_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : 第4期_dgv.Columns(4).DefaultCellStyle.Format = "#,##0.00" : 第4期_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
  144. 第4期_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 第4期_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  145. End Sub
  146. Private Sub Set_合約明細5()
  147. 第5期_dgv.DataSource = Nothing : ds11.Clear()
  148. 第5期_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  149. 第5期_dgv.ColumnHeadersHeight = 25 : 第5期_dgv.AllowUserToAddRows = False
  150. SQL_合約明細讀取()
  151. da.Fill(ds11) : 第5期_dgv.DataSource = ds11.Tables(0) : conn.Close()
  152. 第5期_dgv.Columns(0).Visible = False : 第5期_dgv.Columns(1).Visible = False : 第5期_dgv.Columns(2).FillWeight = 20 : 第5期_dgv.Columns(3).FillWeight = 140
  153. 第5期_dgv.Columns(4).FillWeight = 20 : 第5期_dgv.Columns(5).FillWeight = 50
  154. 第5期_dgv.Columns(2).ReadOnly = True : 第5期_dgv.Columns(5).ReadOnly = True
  155. 第5期_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : 第5期_dgv.Columns(4).DefaultCellStyle.Format = "#,##0.00" : 第5期_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
  156. 第5期_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 第5期_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  157. End Sub
  158. Private Sub 甲方條件下拉清單讀取()
  159. SQL合約條件讀取() : 合約編號1_cb.Items.Clear() : 合約編號1_cb.Items.Add("") : While (dr.Read()) : 合約編號1_cb.Items.Add(dr("約號甲方")) : End While : conn.Close()
  160. End Sub
  161. Private Sub 語言轉換讀取()
  162. If 系統語言 = "繁體中文" Then : 語言 = "CH" : ElseIf 系統語言 = "English" Then : 語言 = "EN" : ElseIf 系統語言 = "Indonesian" Then : 語言 = "IN" : End If
  163. Me.Text = 系統語言字典("H001-131-" & 語言) : ToolTip1.ToolTipTitle = 系統語言字典("G000-108-" & 語言) : Label7.Text = 系統語言字典("H104-106-" & 語言)
  164. Label11.Text = 系統語言字典("H110-118-" & 語言) : Label2.Text = 系統語言字典("H501-144-" & 語言) : Label372.Text = 系統語言字典("H112-100-" & 語言)
  165. Label375.Text = 系統語言字典("G000-215-" & 語言) : Label378.Text = 系統語言字典("G000-216-" & 語言) : CH2.Text = 系統語言字典("H108-101-" & 語言) & "=Rp."
  166. Label21.Text = 系統語言字典("H108-101-" & 語言) : TabPage5.Text = 系統語言字典("H108-102-" & 語言) : Label390.Text = 系統語言字典("H108-102-" & 語言)
  167. TabPage6.Text = 系統語言字典("H108-103-" & 語言) : Label389.Text = 系統語言字典("H108-103-" & 語言) : TabPage7.Text = 系統語言字典("H108-104-" & 語言)
  168. Label388.Text = 系統語言字典("H108-104-" & 語言) : TabPage8.Text = 系統語言字典("H108-105-" & 語言) : Label387.Text = 系統語言字典("H108-105-" & 語言)
  169. TabPage9.Text = 系統語言字典("H108-106-" & 語言) : Label386.Text = 系統語言字典("H108-106-" & 語言) : 新增資料_bt.Text = 系統語言字典("H104-115-" & 語言)
  170. 刪除資料_bt.Text = 系統語言字典("H108-107-" & 語言) : Label19.Text = 系統語言字典("H108-108-" & 語言) : Label5.Text = 系統語言字典("H104-105-" & 語言)
  171. 存檔_tb.Text = 系統語言字典("H108-109-" & 語言)
  172. Label40.Text = 系統語言字典("H108-112-" & 語言) : Label41.Text = 系統語言字典("H108-113-" & 語言) : Label38.Text = 系統語言字典("H108-114-" & 語言)
  173. Label43.Text = 系統語言字典("H311-102-" & 語言) : Label45.Text = 系統語言字典("H108-115-" & 語言) : Label44.Text = 系統語言字典("H108-116-" & 語言)
  174. Label46.Text = 系統語言字典("H108-117-" & 語言) : Label414.Text = 系統語言字典("H303-117-" & 語言) : 主頁_ch.Text = 系統語言字典("H108-118-" & 語言)
  175. 主頁明細_ch.Text = 系統語言字典("H108-119-" & 語言) : 請款單_ch.Text = 系統語言字典("H108-120-" & 語言) : 報告移交單_ch.Text = 系統語言字典("H108-121-" & 語言)
  176. 新版_ch.Text = 系統語言字典("H108-122-" & 語言) : 表頭(1) = 系統語言字典("H501-152-" & 語言) : 表頭(2) = 系統語言字典("H112-118-" & 語言)
  177. 表頭(3) = 系統語言字典("G000-157-" & 語言) : 表頭(4) = 系統語言字典("H104-100-" & 語言) : 表頭(5) = 系統語言字典("H307-106-" & 語言)
  178. 表頭(6) = 系統語言字典("H108-144-" & 語言) : 表頭(7) = 系統語言字典("H108-114-" & 語言) : 表頭(8) = 系統語言字典("H108-145-" & 語言)
  179. 表頭(9) = 系統語言字典("H311-102-" & 語言) : 表頭(10) = 系統語言字典("H108-146-" & 語言) : 表頭(11) = 系統語言字典("H108-147-" & 語言)
  180. 表頭(12) = 系統語言字典("H108-148-" & 語言) : 表頭(13) = 系統語言字典("H903-108-" & 語言) : 表頭(14) = 系統語言字典("H108-114-" & 語言)
  181. 表頭(15) = 系統語言字典("H204-109-" & 語言) : CH1.Text = 系統語言字典("H108-100-" & 語言) : 對話框(0) = 系統語言字典("H108-149-" & 語言)
  182. 對話框(1) = 系統語言字典("H108-150-" & 語言)
  183. End Sub
  184. Private Sub 合約請款單_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  185. Me.MdiParent = HX_PGS_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
  186. 風格() : H(108) = True : 介面 = "H108" : 語言轉換讀取() : 顯示說明(999, True)
  187. 工程款1_nud.Value = 30 : 工程款2_nud.Value = 40 : 工程款3_nud.Value = 20 : 工程款4_nud.Value = 5 : 工程款5_nud.Value = 5 : 視窗2_pl.Visible = False '報告移交單_ch.Enabled = False
  188. SOP3_P.Image = My.Resources._1_124 : SOP4_P.Image = My.Resources._1_124 : SOP5_P.Image = My.Resources._1_124 : SOP6_P.Image = My.Resources._1_124 : SOP7_P.Image = My.Resources._1_124
  189. SOP3_P.SizeMode = 4 : SOP4_P.SizeMode = 4 : SOP5_P.SizeMode = 4 : SOP6_P.SizeMode = 4 : SOP7_P.SizeMode = 4 : Label47.Text = ""
  190. 甲方條件下拉清單讀取() : Set_合約清單() : 合約報價單_Siz()
  191. End Sub
  192. Private Sub 合約驗收單_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
  193. If 待辦進入 <> "" Then : lastFoundRowIndex = -1 : lastFoundColIndex = -1
  194. 關鍵字搜尋_tb.Text = 待辦進入 : 查詢DGV中的關鍵字_自動(合約_dgv, 關鍵字搜尋_tb) : 選擇項 = lastFoundRowIndex : 合約資料讀取()
  195. lastFoundRowIndex = -1 : lastFoundColIndex = -1 : 關鍵字搜尋_tb.Text = "" : 待辦進入 = ""
  196. End If
  197. End Sub
  198. Private Sub 合約請款單_Closed(sender As Object, e As EventArgs) Handles MyBase.Closed
  199. MyMod.虛擬桌面開啟()
  200. End Sub
  201. Private Sub 合約報價單_Siz()
  202. MyMod.清單字體大小調整()
  203. 合約_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", 7.6)
  204. 合約附錄_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  205. 請款單_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  206. 第1期_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  207. 第2期_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  208. 第3期_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  209. 第4期_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  210. 第5期_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  211. End Sub
  212. Private Sub 登入閒置控制_MouseMove(sender As Object, e As EventArgs) Handles MyBase.MouseMove
  213. timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
  214. End Sub
  215. Private Sub 登入閒置控制_KeyPress(sender As Object, e As EventArgs) Handles MyBase.KeyPress
  216. timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
  217. End Sub
  218. Private Sub 語轉扭_bt_Click(sender As Object, e As EventArgs) Handles 語轉扭_bt.Click
  219. 介面 = "H108" : 語言轉換讀取()
  220. End Sub
  221. Private Sub 請款計算()
  222. BNUD1.Value = 金額1_und.Value : BNUD2.Value = 金額2_und.Value : BNUD3.Value = 金額3_und.Value : BNUD4.Value = 金額4_und.Value : BNUD5.Value = 金額5_und.Value
  223. ANUD4.Value = 0 : For i As Integer = 0 To 請款單_dgv.Rows.Count - 1 : ANUD4.Value += 請款單_dgv(表頭(10), i).Value.ToString : Next
  224. ANUD1.Value = NUD3.Value : ANUD3.Value = NUD5.Value : ANUD2.Value = ANUD1.Value + ANUD3.Value : ANUD5.Value = ANUD2.Value - ANUD4.Value
  225. '----收款累加---------------
  226. Dim 已收款 As Long = 0
  227. For DD As Integer = 0 To 1
  228. For i As Integer = 0 To 請款單_dgv.Rows.Count - 1 : 已收款 += 請款單_dgv(表頭(10), i).Value : Next
  229. If 已收款 = 0 Then : Else
  230. If 已收款 = BNUD1.Value Then : BNUD1.Value = 0 : Exit For : ElseIf 已收款 < BNUD1.Value Then : BNUD1.Value = BNUD1.Value - 已收款 : Exit For
  231. ElseIf 已收款 > BNUD1.Value Then : 已收款 -= BNUD1.Value : BNUD1.Value = 0 : End If
  232. If 已收款 = BNUD2.Value Then : BNUD2.Value = 0 : Exit For : ElseIf 已收款 < BNUD2.Value Then : BNUD2.Value = BNUD2.Value - 已收款 : Exit For
  233. ElseIf 已收款 > BNUD2.Value Then : 已收款 -= BNUD2.Value : BNUD2.Value = 0 : End If
  234. If 已收款 = BNUD3.Value Then : BNUD3.Value = 0 : Exit For : ElseIf 已收款 < BNUD3.Value Then : BNUD3.Value = BNUD3.Value - 已收款 : Exit For
  235. ElseIf 已收款 > BNUD3.Value Then : 已收款 -= BNUD3.Value : BNUD3.Value = 0 : End If
  236. If 已收款 = BNUD4.Value Then : BNUD4.Value = 0 : Exit For : ElseIf 已收款 < BNUD4.Value Then : BNUD4.Value = BNUD4.Value - 已收款 : Exit For
  237. ElseIf 已收款 > BNUD4.Value Then : 已收款 -= BNUD4.Value : BNUD4.Value = 0 : End If
  238. If 已收款 = BNUD5.Value Then : BNUD5.Value = 0 : Exit For : ElseIf 已收款 < BNUD5.Value Then : BNUD5.Value = BNUD5.Value - 已收款 : Exit For
  239. ElseIf 已收款 > BNUD5.Value Then : BNUD5.Value = 0 : End If
  240. End If
  241. Next
  242. 'My.Resources._1_123 綠色 My.Resources._1_124 紅色 My.Resources._1_125 橘色
  243. If 工程款1_nud.Value > 0 And BNUD1.Value > 0 Then : SOP3_P.Image = My.Resources._1_125 : ElseIf 工程款1_nud.Value > 0 And BNUD1.Value = 0 Then : SOP3_P.Image = My.Resources._1_123
  244. ElseIf 工程款1_nud.Value = 0 And BNUD1.Value = 0 Then : SOP3_P.Image = My.Resources._1_124 : End If : SOP3_P.SizeMode = 4
  245. If 工程款2_nud.Value > 0 And BNUD2.Value > 0 Then : SOP4_P.Image = My.Resources._1_125 : ElseIf 工程款2_nud.Value > 0 And BNUD2.Value = 0 Then : SOP4_P.Image = My.Resources._1_123
  246. ElseIf 工程款2_nud.Value = 0 And BNUD2.Value = 0 Then : SOP4_P.Image = My.Resources._1_124 : End If : SOP4_P.SizeMode = 4
  247. If 工程款3_nud.Value > 0 And BNUD3.Value > 0 Then : SOP5_P.Image = My.Resources._1_125 : ElseIf 工程款3_nud.Value > 0 And BNUD3.Value = 0 Then : SOP5_P.Image = My.Resources._1_123
  248. ElseIf 工程款3_nud.Value = 0 And BNUD3.Value = 0 Then : SOP5_P.Image = My.Resources._1_124 : End If : SOP5_P.SizeMode = 4
  249. If 工程款4_nud.Value > 0 And BNUD4.Value > 0 Then : SOP6_P.Image = My.Resources._1_125 : ElseIf 工程款4_nud.Value > 0 And BNUD4.Value = 0 Then : SOP6_P.Image = My.Resources._1_123
  250. ElseIf 工程款4_nud.Value = 0 And BNUD4.Value = 0 Then : SOP6_P.Image = My.Resources._1_124 : End If : SOP6_P.SizeMode = 4
  251. If 工程款5_nud.Value > 0 And BNUD5.Value > 0 Then : SOP7_P.Image = My.Resources._1_125 : ElseIf 工程款5_nud.Value > 0 And BNUD5.Value = 0 Then : SOP7_P.Image = My.Resources._1_123
  252. ElseIf 工程款5_nud.Value = 0 And BNUD5.Value = 0 Then : SOP7_P.Image = My.Resources._1_124 : End If : SOP7_P.SizeMode = 4
  253. PA = 合約編號_tb.Text : PA1 = ANUD3.Value : PA2 = ANUD2.Value : PA3 = ANUD4.Value : PA4 = ANUD5.Value : PA5 = BNUD1.Value : PA6 = BNUD2.Value
  254. PA7 = BNUD3.Value : PA8 = BNUD4.Value : PA9 = BNUD5.Value : SQL_控制表_請款修改()
  255. End Sub
  256. Private Sub 合約_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 合約_dgv.CellClick
  257. If e.RowIndex = -1 Then : Else : 選擇項 = e.RowIndex : 合約資料讀取() : End If
  258. End Sub
  259. Private Sub 合約資料讀取()
  260. 請款單號_tb.Text = "" : 請款期數_cb.Text = "" : 比例_nud.Value = 0 : 稅金_nud.Value = 0 : 請款金額_nud.Value = 0 : 請款總額_nud.Value = 0 : 付款期限_cb.Text = ""
  261. 報告移交計算()
  262. If 放大 = True Then : 縮放2_bt.PerformClick() : End If : 合約編號_tb.Text = 合約_dgv(表頭(1), 選擇項).Value.ToString : PA = 合約編號_tb.Text : Set_合約報價總表()
  263. If 報價總表_dgv.Rows.Count > 0 Then
  264. For i As Integer = 0 To 報價總表_dgv.Rows.Count - 1
  265. If 報價總表_dgv.Rows(i).Cells("DESCRIPTION").Value.ToString = "稅金 10% Tax" Then : 稅額顯示_lb.Text = "PPN 10%稅額 = Rp. "
  266. ElseIf 報價總表_dgv.Rows(i).Cells("DESCRIPTION").Value.ToString = "稅金 11% Tax" Then : 稅額顯示_lb.Text = "PPN 11%稅額 = Rp. " : End If
  267. If 報價總表_dgv.Rows(i).Cells("DESCRIPTION").Value.ToString = "總計 Grand Total" Then : NUD3.Value = 報價總表_dgv.Rows(i).Cells("AMOUNT (RP)").Value : End If
  268. Next
  269. Else : 稅額顯示_lb.Text = "PPN 10%稅額 = Rp. " : End If
  270. B09_tb.Text = 合約_dgv("客戶地址", 選擇項).Value.ToString() : B24_tb.Text = "" : B25_tb.Text = "" : B26_tb.Text = ""
  271. If 合約_dgv("驗收完成日期", 選擇項).Value.ToString() <> "" Then
  272. DTP1.Value = 合約_dgv("驗收完成日期", 選擇項).Value.ToString() : B44_tb.Text = 合約_dgv.Rows(選擇項).Cells("保固期限").Value.ToString
  273. Dim 保固日 As String = Strings.Format(DTP1.Value.AddMonths(CInt(合約_dgv.Rows(選擇項).Cells("保固期限").Value.ToString)))
  274. B24_tb.Text = Strings.Right(Strings.Format(合約_dgv("驗收完成日期", 選擇項).Value.ToString()), 2)
  275. B26_tb.Text = Strings.Left(Strings.Format(合約_dgv("驗收完成日期", 選擇項).Value.ToString()), 4)
  276. If Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", 選擇項).Value.ToString()), 6, 2) = "01" Then : B25_tb.Text = "Jan"
  277. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", 選擇項).Value.ToString()), 6, 2) = "02" Then : B25_tb.Text = "Feb"
  278. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", 選擇項).Value.ToString()), 6, 2) = "03" Then : B25_tb.Text = "Ber"
  279. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", 選擇項).Value.ToString()), 6, 2) = "04" Then : B25_tb.Text = "Apr"
  280. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", 選擇項).Value.ToString()), 6, 2) = "05" Then : B25_tb.Text = "Mun"
  281. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", 選擇項).Value.ToString()), 6, 2) = "06" Then : B25_tb.Text = "Jun"
  282. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", 選擇項).Value.ToString()), 6, 2) = "07" Then : B25_tb.Text = "Jul"
  283. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", 選擇項).Value.ToString()), 6, 2) = "08" Then : B25_tb.Text = "Agu"
  284. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", 選擇項).Value.ToString()), 6, 2) = "09" Then : B25_tb.Text = "Sep"
  285. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", 選擇項).Value.ToString()), 6, 2) = "10" Then : B25_tb.Text = "Okt"
  286. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", 選擇項).Value.ToString()), 6, 2) = "11" Then : B25_tb.Text = "Nov"
  287. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", 選擇項).Value.ToString()), 6, 2) = "12" Then : B25_tb.Text = "Des" : End If
  288. B27_tb.Text = Strings.Right(保固日, 2) : B29_tb.Text = Strings.Left(保固日, 4)
  289. If Strings.Mid(保固日, 6, 2) = "01" Then : B28_tb.Text = "Jan" : ElseIf Strings.Mid(保固日, 6, 2) = "02" Then : B28_tb.Text = "Feb"
  290. ElseIf Strings.Mid(保固日, 6, 2) = "03" Then : B28_tb.Text = "Ber" : ElseIf Strings.Mid(保固日, 6, 2) = "04" Then : B28_tb.Text = "Apr"
  291. ElseIf Strings.Mid(保固日, 6, 2) = "05" Then : B28_tb.Text = "Mun" : ElseIf Strings.Mid(保固日, 6, 2) = "06" Then : B28_tb.Text = "Jun"
  292. ElseIf Strings.Mid(保固日, 6, 2) = "07" Then : B28_tb.Text = "Jul" : ElseIf Strings.Mid(保固日, 6, 2) = "08" Then : B28_tb.Text = "Agu"
  293. ElseIf Strings.Mid(保固日, 6, 2) = "09" Then : B28_tb.Text = "Sep" : ElseIf Strings.Mid(保固日, 6, 2) = "10" Then : B28_tb.Text = "Okt"
  294. ElseIf Strings.Mid(保固日, 6, 2) = "11" Then : B28_tb.Text = "Nov" : ElseIf Strings.Mid(保固日, 6, 2) = "12" Then : B28_tb.Text = "Des" : End If
  295. End If
  296. 甲方_tb.Text = 合約_dgv("約號甲方", 選擇項).Value.ToString
  297. 客戶名稱_tb.Text = 合約_dgv("客戶名稱", 選擇項).Value.ToString : 工程名稱_英_tb.Text = 合約_dgv("工程名稱_英", 選擇項).Value.ToString
  298. 工程名稱_中_tb.Text = 合約_dgv(表頭(2), 選擇項).Value.ToString : 工程款1_nud.Value = 合約_dgv("第一期比例", 選擇項).Value
  299. 工程款2_nud.Value = 合約_dgv("第二期比例", 選擇項).Value : 工程款3_nud.Value = 合約_dgv("第三期比例", 選擇項).Value
  300. 工程款4_nud.Value = 合約_dgv("第四期比例", 選擇項).Value : 工程款5_nud.Value = 合約_dgv("第五期比例", 選擇項).Value
  301. CH2.Checked = True : NUD3.Value = 合約_dgv("工程總價", 選擇項).Value
  302. NUD3.Value = 合約_dgv("工程總價", 選擇項).Value : NUD6.Value = 0
  303. PA1 = "1" : Set_合約明細1() : PA1 = "2" : Set_合約明細2() : PA1 = "3" : Set_合約明細3() : PA1 = "4" : Set_合約明細4() : PA1 = "5" : Set_合約明細5()
  304. Set_附錄清單()
  305. If 合約附錄_dgv.Rows.Count > 0 Then
  306. NUD4.Value = 合約附錄_dgv("原金額", 0).Value : NUD5.Value = 合約附錄_dgv("追加減", 0).Value : 附錄編號_tb.Text = 合約附錄_dgv(表頭(4), 0).Value.ToString
  307. Else : NUD4.Value = 0 : NUD5.Value = 0 : 附錄編號_tb.Text = "" : End If
  308. Set_請款清單() : 請款計算() : NUD3.Value += 1 : NUD3.Value -= 1
  309. End Sub
  310. Private Sub 合約附錄_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 合約附錄_dgv.CellClick
  311. NUD4.Value = 合約附錄_dgv("原金額", e.RowIndex).Value : NUD5.Value = 合約附錄_dgv("追加減", e.RowIndex).Value
  312. 附錄編號_tb.Text = 合約附錄_dgv(表頭(4), e.RowIndex).Value.ToString : 請款計算()
  313. End Sub
  314. Private Sub 請款單_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 請款單_dgv.CellClick
  315. 請款單號_tb.Text = 請款單_dgv("請款編號", e.RowIndex).Value.ToString : 請款期數_cb.Text = 請款單_dgv(表頭(6), e.RowIndex).Value.ToString
  316. 請款內容_tb.Text = 請款單_dgv("請款內容", e.RowIndex).Value.ToString : 比例_nud.Value = 請款單_dgv(表頭(7), e.RowIndex).Value
  317. 請款金額_nud.Value = 請款單_dgv(表頭(8), e.RowIndex).Value : 稅金_nud.Value = 請款單_dgv(表頭(9), e.RowIndex).Value
  318. 付款期限_cb.Text = 請款單_dgv("付款期限", e.RowIndex).Value.ToString : 申請日期_dtp.Value = 請款單_dgv(表頭(11), e.RowIndex).Value
  319. 其他意見_tb.Text = 請款單_dgv("審批意見", e.RowIndex).Value.ToString : 請款總額_nud.Value = 請款單_dgv(表頭(10), e.RowIndex).Value
  320. 請款_tb.Text = 請款單_dgv("分期", e.RowIndex).Value.ToString
  321. 報告移交計算()
  322. End Sub
  323. Private Sub 第1期_dgv_CellContentCl(sender As Object, e As DataGridViewCellEventArgs) Handles 第1期_dgv.CellEnter
  324. If Not IsNumeric(第1期_dgv.Rows(e.RowIndex).Cells(表頭(14)).Value) Then
  325. MGB(系統語言字典("G000-180-" & 語言), 1)
  326. 第1期_dgv.Rows(e.RowIndex).Cells(表頭(14)).Value = "0" : 第1期_dgv.Rows(e.RowIndex).Cells(表頭(15)).Value = "0"
  327. Else
  328. Dim nn As Integer
  329. For i As Integer = 0 To 第1期_dgv.Rows.Count - 1 : nn += 第1期_dgv.Rows(i).Cells(表頭(14)).Value : Next
  330. If nn > 工程款1_nud.Value Then
  331. Dim SS As String
  332. SS = 系統語言字典("H108-123-" & 語言) : MGB(SS & Strings.Format(工程款1_nud.Value, "#,##0.00") & " % !!", 1)
  333. 第1期_dgv.Rows(e.RowIndex).Cells(表頭(14)).Value = "0" : 第1期_dgv.Rows(e.RowIndex).Cells(表頭(15)).Value = "0"
  334. Else
  335. For i As Integer = 0 To 第1期_dgv.Rows.Count - 1
  336. If 工程款1_nud.Value = 0 Then
  337. 第1期_dgv.Rows(i).Cells(表頭(15)).Value = 0
  338. Else
  339. 第1期_dgv.Rows(i).Cells(表頭(15)).Value = 第1期_dgv.Rows(i).Cells(表頭(14)).Value * 金額1_und.Value / 工程款1_nud.Value
  340. End If
  341. Next i
  342. End If
  343. End If
  344. End Sub
  345. Private Sub 第2期_dgv_CellContentCl(sender As Object, e As DataGridViewCellEventArgs) Handles 第2期_dgv.CellEnter
  346. If Not IsNumeric(第2期_dgv.Rows(e.RowIndex).Cells(表頭(14)).Value) Then
  347. MGB(系統語言字典("G000-180-" & 語言), 1)
  348. 第2期_dgv.Rows(e.RowIndex).Cells(表頭(14)).Value = "0" : 第2期_dgv.Rows(e.RowIndex).Cells(表頭(15)).Value = "0"
  349. Else
  350. Dim nn As Integer
  351. For i As Integer = 0 To 第2期_dgv.Rows.Count - 1 : nn += 第2期_dgv.Rows(i).Cells(表頭(14)).Value : Next
  352. If nn > 工程款2_nud.Value Then
  353. Dim SS As String
  354. SS = 系統語言字典("H108-124-" & 語言) : MGB(SS & Strings.Format(工程款2_nud.Value, "#,##0.00") & " % !!", 1)
  355. 第2期_dgv.Rows(e.RowIndex).Cells(表頭(14)).Value = "0" : 第2期_dgv.Rows(e.RowIndex).Cells(表頭(15)).Value = "0"
  356. Else
  357. For i As Integer = 0 To 第2期_dgv.Rows.Count - 1
  358. If 工程款2_nud.Value = 0 Then
  359. 第2期_dgv.Rows(i).Cells(表頭(15)).Value = 0
  360. Else
  361. 第2期_dgv.Rows(i).Cells(表頭(15)).Value = 第2期_dgv.Rows(i).Cells(表頭(14)).Value * 金額2_und.Value / 工程款2_nud.Value
  362. End If
  363. Next i
  364. End If
  365. End If
  366. End Sub
  367. Private Sub 第3期_dgv_CellContentCl(sender As Object, e As DataGridViewCellEventArgs) Handles 第3期_dgv.CellEnter
  368. If Not IsNumeric(第3期_dgv.Rows(e.RowIndex).Cells(表頭(14)).Value) Then
  369. MGB(系統語言字典("G000-180-" & 語言), 1)
  370. 第3期_dgv.Rows(e.RowIndex).Cells(表頭(14)).Value = "0" : 第3期_dgv.Rows(e.RowIndex).Cells(表頭(15)).Value = "0"
  371. Else
  372. Dim nn As Integer
  373. For i As Integer = 0 To 第3期_dgv.Rows.Count - 1 : nn += 第3期_dgv.Rows(i).Cells(表頭(14)).Value : Next
  374. If nn > 工程款3_nud.Value Then
  375. Dim SS As String
  376. SS = 系統語言字典("H108-125-" & 語言) : MGB(SS & Strings.Format(工程款3_nud.Value, "#,##0.00") & " % !!", 1)
  377. 第3期_dgv.Rows(e.RowIndex).Cells(表頭(14)).Value = "0" : 第3期_dgv.Rows(e.RowIndex).Cells(表頭(15)).Value = "0"
  378. Else
  379. For i As Integer = 0 To 第3期_dgv.Rows.Count - 1
  380. If 工程款3_nud.Value = 0 Then
  381. 第3期_dgv.Rows(i).Cells(表頭(15)).Value = 0
  382. Else
  383. 第3期_dgv.Rows(i).Cells(表頭(15)).Value = 第3期_dgv.Rows(i).Cells(表頭(14)).Value * 金額3_und.Value / 工程款3_nud.Value
  384. End If
  385. Next i
  386. End If
  387. End If
  388. End Sub
  389. Private Sub 第4期_dgv_CellContentCl(sender As Object, e As DataGridViewCellEventArgs) Handles 第4期_dgv.CellEnter
  390. If Not IsNumeric(第4期_dgv.Rows(e.RowIndex).Cells(表頭(14)).Value) Then
  391. MGB(系統語言字典("G000-180-" & 語言), 1)
  392. 第4期_dgv.Rows(e.RowIndex).Cells(表頭(14)).Value = "0" : 第4期_dgv.Rows(e.RowIndex).Cells(表頭(15)).Value = "0"
  393. Else
  394. Dim nn As Integer
  395. For i As Integer = 0 To 第4期_dgv.Rows.Count - 1 : nn += 第4期_dgv.Rows(i).Cells(表頭(14)).Value : Next
  396. If nn > 工程款4_nud.Value Then
  397. Dim SS As String
  398. SS = 系統語言字典("H108-126-" & 語言) : MGB(SS & Strings.Format(工程款4_nud.Value, "#,##0.00") & " % !!", 1)
  399. 第4期_dgv.Rows(e.RowIndex).Cells(表頭(14)).Value = "0" : 第4期_dgv.Rows(e.RowIndex).Cells(表頭(15)).Value = "0"
  400. Else
  401. For i As Integer = 0 To 第4期_dgv.Rows.Count - 1
  402. If 工程款4_nud.Value = 0 Then
  403. 第4期_dgv.Rows(i).Cells(表頭(15)).Value = 0
  404. Else
  405. 第4期_dgv.Rows(i).Cells(表頭(15)).Value = 第4期_dgv.Rows(i).Cells(表頭(14)).Value * 金額4_und.Value / 工程款4_nud.Value
  406. End If
  407. Next i
  408. End If
  409. End If
  410. End Sub
  411. Private Sub 第5期_dgv_CellContentCl(sender As Object, e As DataGridViewCellEventArgs) Handles 第5期_dgv.CellEnter
  412. If Not IsNumeric(第5期_dgv.Rows(e.RowIndex).Cells(表頭(14)).Value) Then
  413. MGB(系統語言字典("G000-180-" & 語言), 1)
  414. 第5期_dgv.Rows(e.RowIndex).Cells(表頭(14)).Value = "0" : 第5期_dgv.Rows(e.RowIndex).Cells(表頭(15)).Value = "0"
  415. Else
  416. Dim nn As Integer
  417. For i As Integer = 0 To 第5期_dgv.Rows.Count - 1 : nn += 第5期_dgv.Rows(i).Cells(表頭(14)).Value : Next
  418. If nn > 工程款5_nud.Value Then
  419. Dim SS As String
  420. SS = 系統語言字典("H108-127-" & 語言) : MGB(SS & Strings.Format(工程款5_nud.Value, "#,##0.00") & " % !!", 1)
  421. 第5期_dgv.Rows(e.RowIndex).Cells(表頭(14)).Value = "0" : 第5期_dgv.Rows(e.RowIndex).Cells(表頭(15)).Value = "0"
  422. Else
  423. For i As Integer = 0 To 第5期_dgv.Rows.Count - 1
  424. If 工程款5_nud.Value = 0 Then
  425. 第5期_dgv.Rows(i).Cells(表頭(15)).Value = 0
  426. Else
  427. 第5期_dgv.Rows(i).Cells(表頭(15)).Value = 第5期_dgv.Rows(i).Cells(表頭(14)).Value * 金額5_und.Value / 工程款5_nud.Value
  428. End If
  429. Next i
  430. End If
  431. End If
  432. End Sub
  433. Private Sub 第1期_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 第1期_dgv.CellClick
  434. If e.RowIndex = -1 Then : Else : 明細選項_bt.Text = 第1期_dgv(表頭(12), e.RowIndex).Value.ToString : 明細選項_bt.Text = Strings.Format(Val(明細選項_bt.Text), "#,##0") : End If
  435. End Sub
  436. Private Sub 第2期_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 第2期_dgv.CellClick
  437. If e.RowIndex = -1 Then : Else : 明細選項_bt.Text = 第2期_dgv(表頭(12), e.RowIndex).Value.ToString : 明細選項_bt.Text = Strings.Format(Val(明細選項_bt.Text), "#,##0") : End If
  438. End Sub
  439. Private Sub 第3期_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 第3期_dgv.CellClick
  440. If e.RowIndex = -1 Then : Else : 明細選項_bt.Text = 第3期_dgv(表頭(12), e.RowIndex).Value.ToString : 明細選項_bt.Text = Strings.Format(Val(明細選項_bt.Text), "#,##0") : End If
  441. End Sub
  442. Private Sub 第4期_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 第4期_dgv.CellClick
  443. If e.RowIndex = -1 Then : Else : 明細選項_bt.Text = 第4期_dgv(表頭(12), e.RowIndex).Value.ToString : 明細選項_bt.Text = Strings.Format(Val(明細選項_bt.Text), "#,##0") : End If
  444. End Sub
  445. Private Sub 第5期_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 第5期_dgv.CellClick
  446. If e.RowIndex = -1 Then : Else : 明細選項_bt.Text = 第5期_dgv(表頭(12), e.RowIndex).Value.ToString : 明細選項_bt.Text = Strings.Format(Val(明細選項_bt.Text), "#,##0") : End If
  447. End Sub
  448. Private Sub 合約編號1_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 合約編號1_cb.SelectedIndexChanged
  449. Set_合約清單()
  450. End Sub
  451. Private Sub 合約編號1_cb_Click(sender As Object, e As EventArgs) Handles 合約編號1_cb.Click
  452. CB選擇清單(合約編號1_cb)
  453. End Sub
  454. Private Sub 工程期1_ch_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 工程期1_ch.SelectedIndexChanged
  455. Set_合約清單()
  456. End Sub
  457. Private Sub NUD3_ValueChanged(sender As Object, e As EventArgs) Handles NUD3.ValueChanged
  458. If CH2.Checked = True Then
  459. If 稅額顯示_lb.Text = "PPN 10%稅額 = Rp. " Then : NUD2.Value = NUD3.Value / 110 * 10 : Else : NUD2.Value = NUD3.Value / 111 * 11 : End If
  460. NUD1.Value = NUD3.Value - NUD2.Value
  461. 金額1_und.Value = NUD3.Value / 100 * 工程款1_nud.Value : 金額2_und.Value = NUD3.Value / 100 * 工程款2_nud.Value
  462. 金額3_und.Value = NUD3.Value / 100 * 工程款3_nud.Value : 金額4_und.Value = NUD3.Value / 100 * 工程款4_nud.Value
  463. 金額5_und.Value = NUD3.Value / 100 * 工程款5_nud.Value
  464. 金額6_und.Value = 金額1_und.Value + 金額2_und.Value + 金額3_und.Value + 金額4_und.Value + 金額5_und.Value
  465. End If
  466. End Sub
  467. Private Sub NUD1_ValueChanged(sender As Object, e As EventArgs) Handles NUD1.ValueChanged
  468. If CH1.Checked = True Then
  469. NUD2.Value = NUD1.Value / 100 * 10 : NUD3.Value = NUD1.Value + NUD2.Value
  470. 金額1_und.Value = NUD3.Value / 100 * 工程款1_nud.Value : 金額2_und.Value = NUD3.Value / 100 * 工程款2_nud.Value
  471. 金額3_und.Value = NUD3.Value / 100 * 工程款3_nud.Value : 金額4_und.Value = NUD3.Value / 100 * 工程款4_nud.Value
  472. 金額5_und.Value = NUD3.Value / 100 * 工程款5_nud.Value
  473. 金額6_und.Value = 金額1_und.Value + 金額2_und.Value + 金額3_und.Value + 金額4_und.Value + 金額5_und.Value
  474. End If
  475. End Sub
  476. Private Sub CH1_CheckedChanged(sender As Object, e As EventArgs) Handles CH1.Click
  477. CH1.Checked = True : CH2.Checked = False : NUD1.Enabled = True : NUD3.Enabled = False
  478. End Sub
  479. Private Sub CH2_CheckedChanged(sender As Object, e As EventArgs) Handles CH2.Click
  480. CH1.Checked = False : CH2.Checked = True : NUD1.Enabled = False : NUD3.Enabled = True
  481. End Sub
  482. Private Sub 工程款1_nud_ValueChanged(sender As Object, e As EventArgs) Handles 工程款1_nud.ValueChanged
  483. 工程款6_nud.Value = 工程款1_nud.Value + 工程款2_nud.Value + 工程款3_nud.Value + 工程款4_nud.Value + 工程款5_nud.Value
  484. 金額1_und.Value = NUD3.Value / 100 * 工程款1_nud.Value : 金額6_und.Value = 金額1_und.Value + 金額2_und.Value + 金額3_und.Value + 金額4_und.Value + 金額5_und.Value
  485. End Sub
  486. Private Sub 工程款2_nud_ValueChanged(sender As Object, e As EventArgs) Handles 工程款2_nud.ValueChanged
  487. 工程款6_nud.Value = 工程款1_nud.Value + 工程款2_nud.Value + 工程款3_nud.Value + 工程款4_nud.Value + 工程款5_nud.Value
  488. 金額2_und.Value = NUD3.Value / 100 * 工程款2_nud.Value : 金額6_und.Value = 金額1_und.Value + 金額2_und.Value + 金額3_und.Value + 金額4_und.Value + 金額5_und.Value
  489. End Sub
  490. Private Sub 工程款3_nud_ValueChanged(sender As Object, e As EventArgs) Handles 工程款3_nud.ValueChanged
  491. 工程款6_nud.Value = 工程款1_nud.Value + 工程款2_nud.Value + 工程款3_nud.Value + 工程款4_nud.Value + 工程款5_nud.Value
  492. 金額3_und.Value = NUD3.Value / 100 * 工程款3_nud.Value : 金額6_und.Value = 金額1_und.Value + 金額2_und.Value + 金額3_und.Value + 金額4_und.Value + 金額5_und.Value
  493. End Sub
  494. Private Sub 工程款4_nud_ValueChanged(sender As Object, e As EventArgs) Handles 工程款4_nud.ValueChanged
  495. 工程款6_nud.Value = 工程款1_nud.Value + 工程款2_nud.Value + 工程款3_nud.Value + 工程款4_nud.Value + 工程款5_nud.Value
  496. 金額4_und.Value = NUD3.Value / 100 * 工程款4_nud.Value : 金額6_und.Value = 金額1_und.Value + 金額2_und.Value + 金額3_und.Value + 金額4_und.Value + 金額5_und.Value
  497. End Sub
  498. Private Sub 工程款5_nud_ValueChanged(sender As Object, e As EventArgs) Handles 工程款5_nud.ValueChanged
  499. 工程款6_nud.Value = 工程款1_nud.Value + 工程款2_nud.Value + 工程款3_nud.Value + 工程款4_nud.Value + 工程款5_nud.Value
  500. 金額5_und.Value = NUD3.Value / 100 * 工程款5_nud.Value : 金額6_und.Value = 金額1_und.Value + 金額2_und.Value + 金額3_und.Value + 金額4_und.Value + 金額5_und.Value
  501. End Sub
  502. Private Sub NUD4_ValueChanged(sender As Object, e As EventArgs) Handles NUD4.ValueChanged
  503. NUD6.Value = NUD4.Value + NUD5.Value
  504. End Sub
  505. Private Sub NUD5_ValueChanged(sender As Object, e As EventArgs) Handles NUD5.ValueChanged
  506. NUD6.Value = NUD4.Value + NUD5.Value
  507. End Sub
  508. Private Sub 比例_nud_ValueChanged(sender As Object, e As EventArgs) Handles 比例_nud.ValueChanged
  509. 請款金額_nud.Value = NUD1.Value / 100 * 比例_nud.Value
  510. End Sub
  511. Private Sub 稅金_nud_ValueChanged(sender As Object, e As EventArgs) Handles 稅金_nud.ValueChanged
  512. 請款總額_nud.Value = 請款金額_nud.Value / 100 * 稅金_nud.Value + 請款金額_nud.Value
  513. End Sub
  514. Private Sub 請款金額_nud_ValueChanged(sender As Object, e As EventArgs) Handles 請款金額_nud.ValueChanged
  515. If 請款金額_nud.Value / NUD1.Value * 100 > 100 Then : 比例_nud.Value = 100 : Else : 比例_nud.Value = 請款金額_nud.Value / NUD1.Value * 100 : End If
  516. 請款總額_nud.Value = 請款金額_nud.Value / 100 * 稅金_nud.Value + 請款金額_nud.Value
  517. End Sub
  518. Private Sub 請款總額_nud_ValueChanged(sender As Object, e As EventArgs) Handles 請款總額_nud.ValueChanged
  519. 請款金額_nud.Value = 請款總額_nud.Value / (100 + 稅金_nud.Value) * 100
  520. End Sub
  521. Private Sub 請款期數_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 請款期數_cb.SelectedIndexChanged
  522. If 請款期數_cb.Text = "" Then : 比例_nud.Value = 0
  523. ElseIf 請款期數_cb.Text = "一" Then
  524. 比例_nud.Value = 工程款1_nud.Value : 請款內容_tb.Text = "Prepayments 預付款" : 主頁明細_ch.Checked = False : 報告移交單_ch.Checked = False
  525. ElseIf 請款期數_cb.Text = "二" Then
  526. 比例_nud.Value = 工程款2_nud.Value : 請款內容_tb.Text = "Material Cost Application 材料到貨款" : 主頁明細_ch.Checked = False : 報告移交單_ch.Checked = False
  527. ElseIf 請款期數_cb.Text = "三" Then
  528. 比例_nud.Value = 工程款3_nud.Value : 請款內容_tb.Text = "Installation Fee Application 施工請款 " : 主頁明細_ch.Checked = False : 報告移交單_ch.Checked = False
  529. ElseIf 請款期數_cb.Text = "四" Then
  530. 比例_nud.Value = 工程款4_nud.Value : 請款內容_tb.Text = "Final Acceptance 驗收款 " : 主頁明細_ch.Checked = True : 報告移交單_ch.Checked = True
  531. ElseIf 請款期數_cb.Text = "五" Then
  532. 比例_nud.Value = 工程款5_nud.Value : 請款內容_tb.Text = "Assure 保留款 " : 主頁明細_ch.Checked = False : 報告移交單_ch.Checked = True
  533. End If
  534. End Sub
  535. Private Sub 請款期數_cb_Click(sender As Object, e As EventArgs) Handles 請款期數_cb.Click
  536. CB選擇清單(請款期數_cb)
  537. End Sub
  538. Private Sub 新增資料_bt_Click(sender As Object, e As EventArgs) Handles 新增資料_bt.Click
  539. If 合約編號_tb.Text = "" Then : MGB(系統語言字典("H108-128-" & 語言), 1) : Else
  540. If 工程款6_nud.Value <> 100 Then : MGB(系統語言字典("H108-129-" & 語言), 1) : Else
  541. PA = 合約編號_tb.Text : 合約明細存檔()
  542. Dim SS As String
  543. SS = 系統語言字典("H108-130-" & 語言)
  544. If TabControl2.SelectedIndex = 0 Then
  545. If 第1期_dgv.Rows.Count = 10 Then : MGB(SS, 1) : Else : PA1 = "1" : PA2 = 第1期_dgv.Rows.Count + 1 : SQL_合約明細新增() : End If
  546. ElseIf TabControl2.SelectedIndex = 1 Then
  547. If 第2期_dgv.Rows.Count = 10 Then : MGB(SS, 1) : Else : PA1 = "2" : PA2 = 第2期_dgv.Rows.Count + 1 : SQL_合約明細新增() : End If
  548. ElseIf TabControl2.SelectedIndex = 2 Then
  549. If 第3期_dgv.Rows.Count = 10 Then : MGB(SS, 1) : Else : PA1 = "3" : PA2 = 第3期_dgv.Rows.Count + 1 : SQL_合約明細新增() : End If
  550. ElseIf TabControl2.SelectedIndex = 3 Then
  551. If 第4期_dgv.Rows.Count = 10 Then : MGB(SS, 1) : Else : PA1 = "4" : PA2 = 第4期_dgv.Rows.Count + 1 : SQL_合約明細新增() : End If
  552. ElseIf TabControl2.SelectedIndex = 4 Then
  553. If 第5期_dgv.Rows.Count = 10 Then : MGB(SS, 1) : Else : PA1 = "5" : PA2 = 第5期_dgv.Rows.Count + 1 : SQL_合約明細新增() : End If
  554. End If
  555. PA = 合約編號_tb.Text
  556. PA1 = "1" : Set_合約明細1() : PA1 = "2" : Set_合約明細2() : PA1 = "3" : Set_合約明細3() : PA1 = "4" : Set_合約明細4() : PA1 = "5" : Set_合約明細5()
  557. MGB(系統語言字典("G000-118-" & 語言), 1)
  558. End If
  559. End If
  560. End Sub
  561. Private Sub 刪除資料_bt_Click(sender As Object, e As EventArgs) Handles 刪除資料_bt.Click
  562. If 合約編號_tb.Text = "" Or 明細選項_bt.Text = "" Then : MGB(系統語言字典("H108-128-" & 語言), 1) : Else
  563. If 工程款6_nud.Value <> 100 Then : MGB(系統語言字典("H108-129-" & 語言), 1) : Else
  564. PA = 合約編號_tb.Text
  565. If TabControl2.SelectedIndex = 0 Then : PA1 = "1" : PA2 = 明細選項_bt.Text : SQL_合約明細刪除()
  566. ElseIf TabControl2.SelectedIndex = 1 Then : PA1 = "2" : PA2 = 明細選項_bt.Text : SQL_合約明細刪除()
  567. ElseIf TabControl2.SelectedIndex = 2 Then : PA1 = "3" : PA2 = 明細選項_bt.Text : SQL_合約明細刪除()
  568. ElseIf TabControl2.SelectedIndex = 3 Then : PA1 = "4" : PA2 = 明細選項_bt.Text : SQL_合約明細刪除()
  569. ElseIf TabControl2.SelectedIndex = 4 Then : PA1 = "5" : PA2 = 明細選項_bt.Text : SQL_合約明細刪除()
  570. End If
  571. PA = 合約編號_tb.Text
  572. PA1 = "1" : Set_合約明細1() : PA1 = "2" : Set_合約明細2() : PA1 = "3" : Set_合約明細3() : PA1 = "4" : Set_合約明細4() : PA1 = "5" : Set_合約明細5()
  573. MGB(系統語言字典("G000-120-" & 語言), 1)
  574. End If
  575. End If
  576. End Sub
  577. Private Sub 存檔_tb_Click(sender As Object, e As EventArgs) Handles 存檔_tb.Click
  578. 合約明細存檔() : MGB(系統語言字典("G000-119-" & 語言), 1)
  579. End Sub
  580. Private Sub 合約明細存檔()
  581. For i As Integer = 0 To 第1期_dgv.Rows.Count - 1
  582. PA1 = "1" : PA2 = 第1期_dgv.Rows(i).Cells(表頭(12)).Value : PA3 = 第1期_dgv.Rows(i).Cells(表頭(13)).Value
  583. NU1 = 第1期_dgv.Rows(i).Cells(表頭(14)).Value : NU2 = 第1期_dgv.Rows(i).Cells(表頭(15)).Value : SQL_合約明細修改()
  584. Next
  585. For i As Integer = 0 To 第2期_dgv.Rows.Count - 1
  586. PA1 = "2" : PA2 = 第2期_dgv.Rows(i).Cells(表頭(12)).Value : PA3 = 第2期_dgv.Rows(i).Cells(表頭(13)).Value
  587. NU1 = 第2期_dgv.Rows(i).Cells(表頭(14)).Value : NU2 = 第2期_dgv.Rows(i).Cells(表頭(15)).Value : SQL_合約明細修改()
  588. Next
  589. For i As Integer = 0 To 第3期_dgv.Rows.Count - 1
  590. PA1 = "3" : PA2 = 第3期_dgv.Rows(i).Cells(表頭(12)).Value : PA3 = 第3期_dgv.Rows(i).Cells(表頭(13)).Value
  591. NU1 = 第3期_dgv.Rows(i).Cells(表頭(14)).Value : NU2 = 第3期_dgv.Rows(i).Cells(表頭(15)).Value : SQL_合約明細修改()
  592. Next
  593. For i As Integer = 0 To 第4期_dgv.Rows.Count - 1
  594. PA1 = "4" : PA2 = 第4期_dgv.Rows(i).Cells(表頭(12)).Value : PA3 = 第4期_dgv.Rows(i).Cells(表頭(13)).Value
  595. NU1 = 第4期_dgv.Rows(i).Cells(表頭(14)).Value : NU2 = 第4期_dgv.Rows(i).Cells(表頭(15)).Value : SQL_合約明細修改()
  596. Next
  597. For i As Integer = 0 To 第5期_dgv.Rows.Count - 1
  598. PA1 = "5" : PA2 = 第5期_dgv.Rows(i).Cells(表頭(12)).Value : PA3 = 第5期_dgv.Rows(i).Cells(表頭(13)).Value
  599. NU1 = 第5期_dgv.Rows(i).Cells(表頭(14)).Value : NU2 = 第5期_dgv.Rows(i).Cells(表頭(15)).Value : SQL_合約明細修改()
  600. Next
  601. End Sub
  602. Private Sub 查詢_bt_Click(sender As Object, e As EventArgs) Handles 查詢_bt.Click
  603. PA = 關鍵字搜尋_tb.Text : Set_合約清單()
  604. End Sub
  605. Private Sub 開新的請款單_bt_Click(sender As Object, e As EventArgs) Handles 開新的請款單_bt.Click
  606. If 合約編號_tb.Text = "" Then : MGB(系統語言字典("H110-111-" & 語言), 1) : Else
  607. SQL_請款單_最後一筆資料()
  608. If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("請款編號").ToString, 9)) : Else : EDR = 0 : End If
  609. conn.Close() : EDR += 1
  610. If EDR < 10 Then : ESTR = "HP" & "00000000" & EDR : ElseIf EDR > 9 And EDR < 100 Then : ESTR = "HP" & "0000000" & EDR
  611. ElseIf EDR > 99 And EDR < 1000 Then : ESTR = "HP" & "000000" & EDR : ElseIf EDR > 999 And EDR < 10000 Then : ESTR = "HP" & "00000" & EDR
  612. ElseIf EDR > 9999 And EDR < 100000 Then : ESTR = "HP" & "0000" & EDR : ElseIf EDR > 99999 And EDR < 100000 Then : ESTR = "HP" & "000" & EDR
  613. ElseIf EDR > 999999 And EDR < 1000000 Then : ESTR = "HP" & "00" & EDR : ElseIf EDR > 9999999 And EDR < 10000000 Then : ESTR = "HP" & "0" & EDR
  614. ElseIf EDR > 99999999 Then : ESTR = "HP" & EDR : End If
  615. 請款單號_tb.Text = ESTR : 請款期數_cb.Text = "" : 比例_nud.Value = 0 : 稅金_nud.Value = 11
  616. 付款期限_cb.Text = "" : 申請日期_dtp.Value = Today()
  617. End If
  618. End Sub
  619. Private Sub 存檔_bt_Click(sender As Object, e As EventArgs) Handles 存檔_bt.Click
  620. If 合約編號_tb.Text = "" Then : MGB(系統語言字典("H110-111-" & 語言), 1) : Else
  621. If 請款單號_tb.Text = "" Then : MGB(系統語言字典("H108-131-" & 語言), 1) : Else
  622. If 請款期數_cb.Text = "" Then : MGB(系統語言字典("H108-132-" & 語言), 1) : Else
  623. If 請款金額_nud.Value = 0 Then : MGB(系統語言字典("H108-133-" & 語言), 1) : Else
  624. If 付款期限_cb.Text = "" Then : MGB(系統語言字典("H108-134-" & 語言), 1) : Else
  625. PA = 合約編號_tb.Text : PA1 = 請款單號_tb.Text : PA2 = 請款期數_cb.Text : PA3 = 請款內容_tb.Text : PA4 = 請款金額_nud.Value : PA5 = 稅金_nud.Value
  626. PA6 = 付款期限_cb.Text : PA7 = Strings.Format(申請日期_dtp.Value, "yyyy/MM/dd") : PA8 = 其他意見_tb.Text : PA9 = 請款總額_nud.Value : PA10 = 比例_nud.Value
  627. SQL_請款單_最後一筆資料1()
  628. If dr.Read() Then : SQL_請款單_修改()
  629. Else : If 請款金額_nud.Value > ANUD5.Value Then : MGB(系統語言字典("H108-135-" & 語言), 1) : Else : SQL_請款單_新增() : End If
  630. End If : Set_請款清單() : 請款計算() : MGB(系統語言字典("G000-119-" & 語言), 1)
  631. End If
  632. End If
  633. End If
  634. End If
  635. End If
  636. End Sub
  637. Private Sub 刪除_bt_Click(sender As Object, e As EventArgs) Handles 刪除_bt.Click
  638. If 合約編號_tb.Text = "" Then : MGB(系統語言字典("H110-111-" & 語言), 1) : Else
  639. If 請款單號_tb.Text = "" Then : MGB(系統語言字典("H108-136-" & 語言), 1)
  640. Else : PA1 = 請款單號_tb.Text : SQL_請款單_刪除() : Set_請款清單() : 請款計算() : MGB(系統語言字典("H108-137-" & 語言), 1) : End If
  641. End If
  642. End Sub
  643. Private Sub 報告移交()
  644. B02_tb.Text = Strings.Right(Strings.Format(Today(), "yyyy/MM/dd"), 2) : B04_tb.Text = Strings.Left(Strings.Format(Today(), "yyyy/MM/dd"), 4)
  645. If Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "01" Then : B03_tb.Text = "Jan"
  646. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "02" Then : B03_tb.Text = "Feb"
  647. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "03" Then : B03_tb.Text = "Ber"
  648. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "04" Then : B03_tb.Text = "Apr"
  649. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "05" Then : B03_tb.Text = "Mun"
  650. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "06" Then : B03_tb.Text = "Jun"
  651. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "07" Then : B03_tb.Text = "Jul"
  652. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "08" Then : B03_tb.Text = "Agu"
  653. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "09" Then : B03_tb.Text = "Sep"
  654. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "10" Then : B03_tb.Text = "Okt"
  655. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "11" Then : B03_tb.Text = "Nov"
  656. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "12" Then : B03_tb.Text = "Des" : End If
  657. B36_tb.Text = B02_tb.Text : B37_tb.Text = B03_tb.Text : B38_tb.Text = B04_tb.Text
  658. B07_tb.Text = 客戶名稱_tb.Text : B30_tb.Text = 客戶名稱_tb.Text : B42_tb.Text = 客戶名稱_tb.Text : B22_tb.Text = 合約編號_tb.Text : B23_tb.Text = 工程名稱_英_tb.Text
  659. If Strings.Left(合約編號_tb.Text, 2) = "HX" Then : B12_tb.Text = "PT HONG XHE INDUSTRIAL" : B43_tb.Text = "PT HONG XHE INDUSTRIAL"
  660. Else : B12_tb.Text = "PT PUNCAK GEMILANG SEMESTA" : B43_tb.Text = "PT PUNCAK GEMILANG SEMESTA" : End If
  661. End Sub
  662. Private Sub 報告移交計算()
  663. If 請款期數_cb.Text = "四" Then
  664. Dim SS As Integer = 0
  665. For i As Integer = 0 To 請款單_dgv.Rows.Count - 1 : If 請款單_dgv(表頭(6), i).Value.ToString() <> "五" Then : SS += 請款單_dgv(表頭(7), i).Value : End If : Next
  666. B32_tb.Text = "Pihak kesatu (I) telah memeriksa hasil pekerjaan Pihak kedua (II) yang telah selesai dikerjakan sesuai dengan kontrak."
  667. A01_lb.Text = "BERITA ACARA SERAH TERIMA PERTAMA" : B31_tb.Text = "Penagihan Invoice Pelunasan " & SS & "%" : 報告移交()
  668. B19_tb.Visible = True : B27_tb.Visible = True : B28_tb.Visible = True : B29_tb.Visible = True : B33_tb.Visible = True
  669. B44_tb.Visible = True : B45_tb.Visible = True : B46_tb.Visible = True : 報告移交單_ch.Enabled = True
  670. ElseIf 請款期數_cb.Text = "五" Then
  671. B32_tb.Text = "Pihak kesatu (I) telah memeriksa hasil pekerjaan Pihak kedua (II) yang telah selesai dikerjakan dan dinyatakan 100% selesai dalam masa garansi."
  672. A01_lb.Text = "BERITA ACARA SERAH TERIMA KEDUA" : B31_tb.Text = "Penagihan Invoice Pelunasan 100%" : 報告移交()
  673. B19_tb.Visible = False : B27_tb.Visible = False : B28_tb.Visible = False : B29_tb.Visible = False : B33_tb.Visible = False
  674. B44_tb.Visible = False : B45_tb.Visible = False : B46_tb.Visible = False : 報告移交單_ch.Enabled = True
  675. Else
  676. 視窗2_pl.Visible = False : 報告移交單_ch.Enabled = False : 報告移交單_ch.Checked = False
  677. End If
  678. End Sub
  679. Private Sub 報告移交_bt_Click(sender As Object, e As EventArgs) Handles 報告移交_bt.Click
  680. If 視窗2_pl.Visible = False Then : 視窗2_pl.BringToFront()
  681. If 請款期數_cb.Text = "四" Then : 視窗2_pl.Location = New System.Drawing.Point(261, 19) : 視窗2_pl.Visible = True : 報告移交計算()
  682. ElseIf 請款期數_cb.Text = "五" Then : 視窗2_pl.Location = New System.Drawing.Point(261, 19) : 視窗2_pl.Visible = True : 報告移交計算()
  683. Else : 視窗2_pl.Visible = False : 報告移交單_ch.Checked = False : MGB(系統語言字典("H108-138-" & 語言), 1) : End If
  684. Else : 視窗2_pl.Visible = False : End If
  685. End Sub
  686. Private Sub CanceL2_bt_Click(sender As Object, e As EventArgs) Handles CanceL2_bt.Click
  687. If 視窗2_pl.Visible = False Then : 視窗2_pl.Visible = True : 視窗2_pl.BringToFront() : Else
  688. 視窗2_pl.Visible = False : End If
  689. End Sub
  690. Private Sub 視窗2_pl_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 視窗2_pl.MouseDown
  691. If e.Button = MouseButtons.Left Then : OldX = e.X : OldY = e.Y : drag = True : End If
  692. End Sub
  693. Private Sub 視窗2_pl_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 視窗2_pl.MouseMove
  694. If drag Then : 視窗2_pl.Left = 視窗2_pl.Left + e.X - OldX : 視窗2_pl.Top = 視窗2_pl.Top + e.Y - OldY : End If
  695. End Sub
  696. Private Sub 縮放2_bt_Click(sender As Object, e As EventArgs) Handles 縮放2_bt.Click
  697. Dim NX, NY As Integer : NX = 合約_dgv.Size.Width : NY = 合約_dgv.Size.Height
  698. If 放大 = True Then
  699. 合約_dgv.Size = New System.Drawing.Point(NX - 400, NY) : 放大 = False : 合約_dgv.Columns(表頭(2)).Visible = False
  700. Else
  701. 合約_dgv.Size = New System.Drawing.Point(NX + 400, NY) : 放大 = True : 合約_dgv.Columns(表頭(2)).Visible = True
  702. End If
  703. End Sub
  704. Private Sub 視窗2_pl_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 視窗2_pl.MouseUp
  705. drag = False
  706. End Sub
  707. Private Sub 縮放2_bt_MouseEnter(sender As Object, e As EventArgs) Handles 縮放2_bt.MouseEnter
  708. ToolTip1.SetToolTip(Me.縮放2_bt, 系統語言字典("G000-198-" & 語言))
  709. End Sub
  710. Private Sub 查詢_bt_MouseEnter(sender As Object, e As EventArgs) Handles 查詢_bt.MouseEnter
  711. ToolTip1.SetToolTip(Me.查詢_bt, 系統語言字典("G000-113-" & 語言))
  712. End Sub
  713. Private Sub 開新的請款單_bt_MouseEnter(sender As Object, e As EventArgs) Handles 開新的請款單_bt.MouseEnter
  714. ToolTip1.SetToolTip(Me.開新的請款單_bt, 系統語言字典("H108-139-" & 語言))
  715. End Sub
  716. Private Sub 存檔_bt_MouseEnter(sender As Object, e As EventArgs) Handles 存檔_bt.MouseEnter
  717. ToolTip1.SetToolTip(Me.存檔_bt, 系統語言字典("G000-110-" & 語言))
  718. End Sub
  719. Private Sub 報告移交_bt_MouseEnter(sender As Object, e As EventArgs) Handles 報告移交_bt.MouseEnter
  720. ToolTip1.SetToolTip(Me.報告移交_bt, 系統語言字典("H108-140-" & 語言))
  721. End Sub
  722. Private Sub 列印_bt_MouseEnter(sender As Object, e As EventArgs) Handles 列印_bt.MouseEnter
  723. ToolTip1.SetToolTip(Me.列印_bt, 系統語言字典("G000-114-" & 語言))
  724. End Sub
  725. Private Sub 刪除_bt_MouseEnter(sender As Object, e As EventArgs) Handles 刪除_bt.MouseEnter
  726. ToolTip1.SetToolTip(Me.刪除_bt, 系統語言字典("G000-112-" & 語言))
  727. End Sub
  728. Private Sub 列印_bt_Click(sender As Object, e As EventArgs) Handles 列印_bt.Click
  729. If 合約編號_tb.Text = "" Then : MGB(系統語言字典("H110-111-" & 語言), 1) : Else
  730. If 請款單號_tb.Text = "" Then : MGB(系統語言字典("H108-136-" & 語言), 1) : Else
  731. If 請款期數_cb.Text = "" Then : MGB(系統語言字典("H108-141-" & 語言), 1) : Else
  732. If 請款金額_nud.Value = 0 Then : MGB(系統語言字典("H108-142-" & 語言), 1) : Else
  733. If 付款期限_cb.Text = "" Then : MGB(系統語言字典("H108-143-" & 語言), 1) : Else
  734. Try
  735. xlApp = CType(CreateObject("Excel.Application"), Application)
  736. xlApp.Visible = True
  737. xlApp.DisplayAlerts = True
  738. xlApp.Application.WindowState = xlMaximized
  739. xlBook = xlApp.Workbooks.Add
  740. '----------------------------------------------------------------------------------------------------------------------
  741. If 報告移交單_ch.Checked = True Then
  742. xlSheet = NewMethod(xlBook) : xlApp.Sheets(1).Select : xlApp.Sheets(1).Name = "報告移交單"
  743. xlBook.Activate() : xlSheet.Activate()
  744. xlSheet.Cells(2, 1) = A01_lb.Text : xlSheet.Cells(4, 1) = B01_tb.Text & " " & B02_tb.Text & " " & B03_tb.Text & " " & B04_tb.Text & " " & B05_tb.Text
  745. xlSheet.Cells(6, 1) = B06_tb.Text : xlSheet.Cells(6, 3) = B07_tb.Text : xlSheet.Cells(7, 1) = B08_tb.Text : xlSheet.Cells(7, 3) = B09_tb.Text
  746. xlSheet.Cells(9, 1) = B10_tb.Text : xlSheet.Cells(11, 1) = B11_tb.Text : xlSheet.Cells(11, 3) = B12_tb.Text : xlSheet.Cells(12, 1) = B13_tb.Text
  747. xlSheet.Cells(12, 3) = B14_tb.Text : xlSheet.Cells(14, 1) = B15_tb.Text
  748. xlSheet.Cells(16, 2) = B16_tb.Text : xlSheet.Cells(16, 3) = "':" : xlSheet.Cells(16, 4) = B22_tb.Text
  749. xlSheet.Cells(17, 2) = B17_tb.Text : xlSheet.Cells(17, 3) = "':" : xlSheet.Cells(17, 4) = B23_tb.Text
  750. xlSheet.Cells(18, 2) = B18_tb.Text : xlSheet.Cells(18, 3) = "':" : xlSheet.Cells(18, 4) = B24_tb.Text & " " & B25_tb.Text & " " & B26_tb.Text
  751. Dim NX As Integer = 19
  752. If 請款期數_cb.Text = "四" Then
  753. xlSheet.Cells(NX, 2) = B19_tb.Text : xlSheet.Cells(NX, 3) = "':" : xlSheet.Cells(NX, 4) = B27_tb.Text & " " & B28_tb.Text & " " & B29_tb.Text : NX += 1
  754. xlSheet.Cells(NX, 2) = B20_tb.Text : xlSheet.Cells(NX, 3) = "':" : xlSheet.Cells(NX, 4) = B30_tb.Text : NX += 1
  755. xlSheet.Cells(NX, 2) = B21_tb.Text : xlSheet.Cells(NX, 3) = "':" : xlSheet.Cells(NX, 4) = B31_tb.Text : NX += 2
  756. xlSheet.Cells(NX, 1) = B32_tb.Text : NX += 1
  757. xlSheet.Cells(NX, 1) = B33_tb.Text + " " + B44_tb.Text + " " + B45_tb.Text + " " & B46_tb.Text : NX += 1
  758. xlSheet.Cells(NX, 1) = B34_tb.Text : NX += 2
  759. xlSheet.Cells(NX, 4) = B35_tb.Text : xlSheet.Cells(NX, 5) = B36_tb.Text & " " & B37_tb.Text & " " & B38_tb.Text : NX += 2
  760. xlSheet.Cells(NX, 5) = B39_tb.Text : NX += 1
  761. xlSheet.Cells(NX, 2) = B40_tb.Text : xlSheet.Cells(NX, 5) = B41_tb.Text : NX += 1
  762. xlSheet.Cells(NX, 2) = B42_tb.Text : xlSheet.Cells(NX, 5) = B43_tb.Text
  763. Else
  764. xlSheet.Cells(NX, 2) = B20_tb.Text : xlSheet.Cells(NX, 3) = "':" : xlSheet.Cells(NX, 4) = B30_tb.Text : NX += 1
  765. xlSheet.Cells(NX, 2) = B21_tb.Text : xlSheet.Cells(NX, 3) = "':" : xlSheet.Cells(NX, 4) = B31_tb.Text : NX += 2
  766. xlSheet.Cells(NX, 1) = B32_tb.Text : NX += 1 : xlSheet.Cells(NX, 1) = B34_tb.Text : NX += 2
  767. xlSheet.Cells(NX, 4) = B35_tb.Text : xlSheet.Cells(NX, 5) = B36_tb.Text & " " & B37_tb.Text & " " & B38_tb.Text : NX += 2
  768. xlSheet.Cells(NX, 5) = B39_tb.Text : NX += 1
  769. xlSheet.Cells(NX, 2) = B40_tb.Text : xlSheet.Cells(NX, 5) = B41_tb.Text : NX += 1
  770. xlSheet.Cells(NX, 2) = B42_tb.Text : xlSheet.Cells(NX, 5) = B43_tb.Text
  771. End If
  772. AB(xlApp, xlSheet)
  773. If Strings.Left(合約編號_tb.Text, 2) = "HX" Then : CC(xlApp, xlSheet) : Else : DD(xlApp, xlSheet) : End If : FF(xlApp, xlSheet)
  774. End If
  775. '----------------------------------------------------------------------------------------------------------------------
  776. If 請款單_ch.Checked = True Then
  777. xlSheet = NewMethod(xlBook) : xlApp.Sheets(1).Select : xlApp.Sheets(1).Name = "請款單"
  778. xlBook.Activate() : xlSheet.Activate()
  779. xlSheet.Cells(2, 1) = "請款明細表 Rincian Tagihan" : xlSheet.Cells(3, 1) = "TO : " & 客戶名稱_tb.Text
  780. xlSheet.Cells(3, 9) = "日期 : " & Strings.Format(Today(), "yyyy/MM/dd")
  781. xlSheet.Cells(4, 1) = "工程項目 : " & 工程名稱_中_tb.Text & vbCrLf & 工程名稱_英_tb.Text : xlSheet.Cells(4, 9) = "期別 : 第" & 請款期數_cb.Text & "期"
  782. xlSheet.Cells(5, 1) = "(未稅)本合約工程款 Total Kontrak Sebelum Ppn Rp : "
  783. If 稅額顯示_lb.Text = "PPN 10%稅額 = Rp. " Then : xlSheet.Cells(5, 5) = 金額6_und.Value / 110 * 100 : Else : xlSheet.Cells(5, 5) = 金額6_und.Value / 111 * 100 : End If
  784. xlSheet.Cells(7, 1) = "No." : xlSheet.Cells(7, 2) = "Description" : xlSheet.Cells(7, 3) = "Rate" : xlSheet.Cells(7, 4) = "Total Amount" & vbCrLf & "總金額"
  785. xlSheet.Cells(7, 5) = "This Period" & vbCrLf & "本期請款" : xlSheet.Cells(7, 7) = "Accumulation" & vbCrLf & "累計請款" : xlSheet.Cells(7, 9) = "Remarks"
  786. If Label47.Text = 對話框(0) Then
  787. If 新版_ch.Checked = False Then
  788. xlSheet.Cells(8, 1) = "1" : xlSheet.Cells(8, 2) = "Prepayments" & vbCrLf & "(預付款)" : xlSheet.Cells(8, 3) = 工程款1_nud.Value / 100
  789. If 請款期數_cb.Text = "一" Then : xlSheet.Cells(8, 5) = "=C8" : Else : xlSheet.Cells(8, 5) = "0" : End If
  790. xlSheet.Cells(9, 1) = "2" : xlSheet.Cells(9, 2) = "Material Cost Application" & vbCrLf & "(材料到貨款)" : xlSheet.Cells(9, 3) = 工程款2_nud.Value / 100
  791. If 請款期數_cb.Text = "二" Then : xlSheet.Cells(9, 5) = "=C9" : Else : xlSheet.Cells(9, 5) = "0" : End If
  792. xlSheet.Cells(10, 1) = "3" : xlSheet.Cells(10, 2) = "Installation Fee Application" & vbCrLf & "(施工請款)" : xlSheet.Cells(10, 3) = 工程款3_nud.Value / 100
  793. If 請款期數_cb.Text = "三" Then : xlSheet.Cells(10, 5) = "=C10" : Else : xlSheet.Cells(10, 5) = "0" : End If
  794. xlSheet.Cells(11, 1) = "4" : xlSheet.Cells(11, 2) = "Final Acceptance" & vbCrLf & "(驗收款)" : xlSheet.Cells(11, 3) = 工程款4_nud.Value / 100
  795. If 請款期數_cb.Text = "四" Then : xlSheet.Cells(11, 5) = "=C11" : Else : xlSheet.Cells(11, 5) = "0" : End If
  796. xlSheet.Cells(12, 1) = "5" : xlSheet.Cells(12, 2) = "Assure" & vbCrLf & "(保留款)" : xlSheet.Cells(12, 3) = 工程款5_nud.Value / 100
  797. If 請款期數_cb.Text = "五" Then : xlSheet.Cells(12, 5) = "=C12" : Else : xlSheet.Cells(12, 5) = "0" : End If
  798. For i As Integer = 8 To 12
  799. If i = 11 Then : xlSheet.Cells(i, 4) = "=C" & i & "*$E$5 + " & ANUD3.Value : Else : xlSheet.Cells(i, 4) = "=C" & i & "*$E$5" : End If
  800. xlSheet.Cells(i, 6) = "=IF(E" & i & "=0,0,D" & i & ")" : xlSheet.Cells(i, 8) = "=G" & i & "*$E$5"
  801. If i = 8 Then : xlSheet.Cells(i, 7) = "=IF(E" & i & "=0,C" & i & ",0)"
  802. Else : xlSheet.Cells(i, 7) = "=IF(J" & i & "=0,IF(E" & i & "=0,C" & i & ",0),0)" : End If
  803. xlSheet.Cells(i, 10) = "=IF(J" & i - 1 & "=1,1,IF(And(D" & i & "<>0,F" & i & "<>0),1,0))"
  804. Next
  805. xlSheet.Cells(13, 1) = "Total" : xlSheet.Cells(13, 4) = "=D12+D11+D10+D9+D8" : xlSheet.Cells(13, 5) = "=E8+E9+E10+E11+E12"
  806. xlSheet.Cells(13, 6) = "=F8+F9+F10+F11+F12" : xlSheet.Cells(13, 7) = "=G8+G9+G10+G11+G12" : xlSheet.Cells(13, 8) = "=H8+H9+H10+H11+H12"
  807. xlSheet.Cells(15, 2) = "本期估驗 Nominal Tagihan" & vbCrLf & "(未稅Belum Termasuk Pajak)" : xlSheet.Cells(15, 3) = "' : "
  808. xlSheet.Cells(15, 4) = "=F13" : xlSheet.Cells(16, 2) = "PPN " & Strings.Format(稅金_nud.Value, "#,##0.0") & "%" : xlSheet.Cells(16, 3) = "' : "
  809. xlSheet.Cells(16, 4) = 請款總額_nud.Value - 請款金額_nud.Value : xlSheet.Cells(17, 4) = "=D15+D16"
  810. xlSheet.Cells(18, 2) = "本期請款金額 Total Tagihan : Rp" : xlSheet.Cells(18, 3) = "' : " : xlSheet.Cells(18, 4) = "=D17"
  811. xlSheet.Cells(18, 7) = "元整" : xlSheet.Cells(18, 8) = "(含稅) Termasuk Ppn" : xlSheet.Cells(21, 2) = 客戶名稱_tb.Text
  812. xlSheet.Cells(22, 2) = "驗收代表人" : BB(xlApp, xlSheet)
  813. Else
  814. xlSheet.Cells(8, 1) = "1" : xlSheet.Cells(8, 2) = "Prepayments" & vbCrLf & "(預付款)" : xlSheet.Cells(8, 3) = 工程款1_nud.Value / 100
  815. If 請款期數_cb.Text = "一" Then : xlSheet.Cells(8, 5) = "=C8" : Else : xlSheet.Cells(8, 5) = "0" : End If
  816. xlSheet.Cells(9, 1) = "2" : xlSheet.Cells(9, 2) = "Material Cost Application" & vbCrLf & "(材料到貨款)" : xlSheet.Cells(9, 3) = 工程款2_nud.Value / 100
  817. If 請款期數_cb.Text = "二" Then : xlSheet.Cells(9, 5) = "=C9" : Else : xlSheet.Cells(9, 5) = "0" : End If
  818. xlSheet.Cells(10, 1) = "3" : xlSheet.Cells(10, 2) = "Installation Fee & Final Application" & vbCrLf & "(施工.驗收款)"
  819. '----------特別調整------------------------------------------------------------------------------------------
  820. If 工程款5_nud.Value = 0 Then : xlSheet.Cells(10, 3) = 工程款3_nud.Value / 100
  821. Else : xlSheet.Cells(10, 3) = 工程款4_nud.Value / 100 + 工程款3_nud.Value / 100 : End If
  822. If 請款期數_cb.Text = "三" Or 請款期數_cb.Text = "四" Then : xlSheet.Cells(10, 5) = "=C10" : Else : xlSheet.Cells(10, 5) = "0" : End If
  823. xlSheet.Cells(11, 1) = "4" : xlSheet.Cells(11, 2) = "Assure" & vbCrLf & "(保留款)"
  824. '----------特別調整------------------------------------------------------------------------------------------
  825. If 工程款5_nud.Value = 0 Then : xlSheet.Cells(11, 3) = 工程款4_nud.Value / 100
  826. Else : xlSheet.Cells(11, 3) = 工程款5_nud.Value / 100 : End If
  827. If 請款期數_cb.Text = "四" Or 請款期數_cb.Text = "五" Then : xlSheet.Cells(11, 5) = "=C11" : Else : xlSheet.Cells(11, 5) = "0" : End If
  828. For i As Integer = 8 To 11
  829. If i = 10 Then : xlSheet.Cells(i, 4) = "=C" & i & "*$E$5 + " & ANUD3.Value : Else : xlSheet.Cells(i, 4) = "=C" & i & "*$E$5" : End If
  830. xlSheet.Cells(i, 6) = "=IF(E" & i & "=0,0,D" & i & ")" : xlSheet.Cells(i, 8) = "=G" & i & "*$E$5"
  831. If i = 8 Then : xlSheet.Cells(i, 7) = "=IF(E" & i & "=0,C" & i & ",0)"
  832. Else : xlSheet.Cells(i, 7) = "=IF(J" & i & "=0,IF(E" & i & "=0,C" & i & ",0),0)" : End If
  833. xlSheet.Cells(i, 10) = "=IF(J" & i - 1 & "=1,1,IF(And(D" & i & "<>0,F" & i & "<>0),1,0))"
  834. Next
  835. xlSheet.Cells(12, 1) = "Total" : xlSheet.Cells(12, 4) = "=D11+D10+D9+D8" : xlSheet.Cells(12, 5) = "=E8+E9+E10+E11"
  836. xlSheet.Cells(12, 6) = "=F8+F9+F10+F11" : xlSheet.Cells(12, 7) = "=G8+G9+G10+G11" : xlSheet.Cells(12, 8) = "=H8+H9+H10+H11"
  837. xlSheet.Cells(14, 2) = "本期估驗 Nominal Tagihan" & vbCrLf & "(未稅Belum Termasuk Pajak)" : xlSheet.Cells(14, 3) = "' : "
  838. xlSheet.Cells(14, 4) = "=F12" : xlSheet.Cells(16, 2) = "PPN " & Strings.Format(稅金_nud.Value, "#,##0.0") & "%" : xlSheet.Cells(15, 3) = "' : "
  839. xlSheet.Cells(15, 4) = 請款總額_nud.Value - 請款金額_nud.Value : xlSheet.Cells(16, 4) = "=D14+D15"
  840. xlSheet.Cells(17, 2) = "本期請款金額 Total Tagihan : Rp" : xlSheet.Cells(17, 3) = "' : " : xlSheet.Cells(17, 4) = "=D16"
  841. xlSheet.Cells(17, 7) = "元整" : xlSheet.Cells(17, 8) = "(含稅) Termasuk Ppn" : xlSheet.Cells(20, 2) = 客戶名稱_tb.Text
  842. xlSheet.Cells(21, 2) = "驗收代表人" : BB2(xlApp, xlSheet)
  843. End If
  844. Else
  845. DF = 0 : Dim HJ As Integer
  846. For i As Integer = 0 To 請款單_dgv.Rows.Count - 1
  847. xlSheet.Cells(8 + i, 1) = i + 1 : xlSheet.Cells(8 + i, 3) = CInt(請款單_dgv(表頭(7), i).Value.ToString()) / 100
  848. xlSheet.Cells(8 + i, 2) = "第" & i + 1 & "次請款" & vbCrLf & "The " & i + 1 & " Installment of The Project Funds"
  849. xlSheet.Cells(8 + i, 4) = "=C" & i + 8 & "*$E$5"
  850. If CInt(請款_tb.Text) = CInt(請款單_dgv("分期", i).Value.ToString()) Then
  851. xlSheet.Cells(8 + i, 5) = CInt(請款單_dgv(表頭(7), i).Value.ToString()) / 100
  852. FG = CInt(請款單_dgv(表頭(8), i).Value.ToString())
  853. GH = CInt(請款單_dgv(表頭(9), i).Value.ToString())
  854. Else
  855. xlSheet.Cells(8 + i, 5) = "0"
  856. End If
  857. xlSheet.Cells(8 + i, 6) = "=IF(E" & 8 + i & "=0,0,D" & 8 + i & ")"
  858. If i = 0 Then
  859. xlSheet.Cells(8 + i, 7) = "=IF(E" & 8 + i & "=0,C" & 8 + i & ",0)"
  860. Else
  861. xlSheet.Cells(8 + i, 7) = "=IF(J" & 8 + i & "=0,IF(E" & 8 + i & "=0,C" & 8 + i & ",0),0)"
  862. End If
  863. xlSheet.Cells(8 + i, 8) = "=G" & 8 + i & "*$E$5"
  864. xlSheet.Cells(8 + i, 10) = "=IF(J" & 7 + i & "=1,1,IF(AND(D" & 8 + i & "<>0,F" & 8 + i & "<>0),1,0))" : HJ = i
  865. Next
  866. If BNUD1.Value > 1000 Then : HJ += 1 : xlSheet.Cells(8 + HJ, 1) = HJ + 1 : xlSheet.Cells(8 + HJ, 2) = Label34.Text
  867. xlSheet.Cells(8 + HJ, 3) = BNUD1.Value / 金額6_und.Value : xlSheet.Cells(8 + HJ, 4) = "=C" & HJ + 8 & "*$E$5"
  868. xlSheet.Cells(8 + HJ, 5) = "0" : xlSheet.Cells(8 + HJ, 6) = "=IF(E" & 8 + HJ & "=0,0,D" & 8 + HJ & ")"
  869. xlSheet.Cells(8 + HJ, 7) = "=IF(J" & 8 + HJ & "=0,IF(E" & 8 + HJ & "=0,C" & 8 + HJ & ",0),0)" : xlSheet.Cells(8 + HJ, 8) = "=G" & 8 + HJ & "*$E$5"
  870. xlSheet.Cells(8 + HJ, 10) = "=IF(J" & 7 + HJ & "=1,1,IF(AND(D" & 8 + HJ & "<>0,F" & 8 + HJ & "<>0),1,0))"
  871. End If
  872. If BNUD2.Value > 1000 Then : HJ += 1 : xlSheet.Cells(8 + HJ, 1) = HJ + 1 : xlSheet.Cells(8 + HJ, 2) = Label33.Text
  873. xlSheet.Cells(8 + HJ, 3) = BNUD2.Value / 金額6_und.Value : xlSheet.Cells(8 + HJ, 4) = "=C" & HJ + 8 & "*$E$5"
  874. xlSheet.Cells(8 + HJ, 5) = "0" : xlSheet.Cells(8 + HJ, 6) = "=IF(E" & 8 + HJ & "=0,0,D" & 8 + HJ & ")"
  875. xlSheet.Cells(8 + HJ, 7) = "=IF(J" & 8 + HJ & "=0,IF(E" & 8 + HJ & "=0,C" & 8 + HJ & ",0),0)" : xlSheet.Cells(8 + HJ, 8) = "=G" & 8 + HJ & "*$E$5"
  876. xlSheet.Cells(8 + HJ, 10) = "=IF(J" & 7 + HJ & "=1,1,IF(AND(D" & 8 + HJ & "<>0,F" & 8 + HJ & "<>0),1,0))"
  877. End If
  878. If BNUD3.Value > 1000 Then : HJ += 1 : xlSheet.Cells(8 + HJ, 1) = HJ + 1 : xlSheet.Cells(8 + HJ, 2) = Label35.Text
  879. xlSheet.Cells(8 + HJ, 3) = BNUD3.Value / 金額6_und.Value : xlSheet.Cells(8 + HJ, 4) = "=C" & HJ + 8 & "*$E$5"
  880. xlSheet.Cells(8 + HJ, 5) = "0" : xlSheet.Cells(8 + HJ, 6) = "=IF(E" & 8 + HJ & "=0,0,D" & 8 + HJ & ")"
  881. xlSheet.Cells(8 + HJ, 7) = "=IF(J" & 8 + HJ & "=0,IF(E" & 8 + HJ & "=0,C" & 8 + HJ & ",0),0)" : xlSheet.Cells(8 + HJ, 8) = "=G" & 8 + HJ & "*$E$5"
  882. xlSheet.Cells(8 + HJ, 10) = "=IF(J" & 7 + HJ & "=1,1,IF(AND(D" & 8 + HJ & "<>0,F" & 8 + HJ & "<>0),1,0))"
  883. End If
  884. If BNUD4.Value > 1000 Then : HJ += 1 : xlSheet.Cells(8 + HJ, 1) = HJ + 1 : xlSheet.Cells(8 + HJ, 2) = Label31.Text
  885. xlSheet.Cells(8 + HJ, 3) = BNUD4.Value / 金額6_und.Value : xlSheet.Cells(8 + HJ, 4) = "=C" & HJ + 8 & "*$E$5"
  886. xlSheet.Cells(8 + HJ, 5) = "0" : xlSheet.Cells(8 + HJ, 6) = "=IF(E" & 8 + HJ & "=0,0,D" & 8 + HJ & ")"
  887. xlSheet.Cells(8 + HJ, 7) = "=IF(J" & 8 + HJ & "=0,IF(E" & 8 + HJ & "=0,C" & 8 + HJ & ",0),0)" : xlSheet.Cells(8 + HJ, 8) = "=G" & 8 + HJ & "*$E$5"
  888. xlSheet.Cells(8 + HJ, 10) = "=IF(J" & 7 + HJ & "=1,1,IF(AND(D" & 8 + HJ & "<>0,F" & 8 + HJ & "<>0),1,0))"
  889. End If
  890. If BNUD5.Value > 1000 Then : HJ += 1 : xlSheet.Cells(8 + HJ, 1) = HJ + 1 : xlSheet.Cells(8 + HJ, 2) = Label32.Text
  891. xlSheet.Cells(8 + HJ, 3) = BNUD5.Value / 金額6_und.Value : xlSheet.Cells(8 + HJ, 4) = "=C" & HJ + 8 & "*$E$5"
  892. xlSheet.Cells(8 + HJ, 5) = "0" : xlSheet.Cells(8 + HJ, 6) = "=IF(E" & 8 + HJ & "=0,0,D" & 8 + HJ & ")"
  893. xlSheet.Cells(8 + HJ, 7) = "=IF(J" & 8 + HJ & "=0,IF(E" & 8 + HJ & "=0,C" & 8 + HJ & ",0),0)" : xlSheet.Cells(8 + HJ, 8) = "=G" & 8 + HJ & "*$E$5"
  894. xlSheet.Cells(8 + HJ, 10) = "=IF(J" & 7 + HJ & "=1,1,IF(AND(D" & 8 + HJ & "<>0,F" & 8 + HJ & "<>0),1,0))"
  895. End If
  896. DF = 9 + HJ
  897. xlSheet.Cells(DF, 1) = "Total" : xlSheet.Cells(DF, 4) = "=SUM(D8:D" & DF - 1 & ")"
  898. xlSheet.Cells(DF, 5) = "=SUM(E8:E" & DF - 1 & ")" : xlSheet.Cells(DF, 6) = "=SUM(F8:F" & DF - 1 & ")"
  899. xlSheet.Cells(DF, 7) = "=SUM(G8:G" & DF - 1 & ")" : xlSheet.Cells(DF, 8) = "=SUM(H8:H" & DF - 1 & ")"
  900. xlSheet.Cells(DF + 2, 2) = "本期估驗 Nominal Tagihan" & vbCrLf & "(未稅Belum Termasuk Pajak)" : xlSheet.Cells(DF + 2, 3) = "' : "
  901. xlSheet.Cells(DF + 2, 4) = FG
  902. xlSheet.Cells(DF + 3, 2) = "PPN " & Strings.Format(稅金_nud.Value, "#,##0.0") & "%" : xlSheet.Cells(DF + 3, 3) = "' : "
  903. xlSheet.Cells(DF + 3, 4) = FG / 100 * GH
  904. xlSheet.Cells(DF + 4, 4) = "=SUM(D" & DF + 2 & "+D" & DF + 3
  905. xlSheet.Cells(DF + 5, 2) = "本期請款金額 Total Tagihan : Rp" : xlSheet.Cells(DF + 5, 3) = "' : " : xlSheet.Cells(DF + 5, 4) = "=D" & DF + 4
  906. xlSheet.Cells(DF + 5, 7) = "元整" : xlSheet.Cells(DF + 5, 8) = "(含稅) Termasuk Ppn" : xlSheet.Cells(DF + 7, 2) = 客戶名稱_tb.Text
  907. xlSheet.Cells(DF + 8, 2) = "驗收代表人" : BB3(xlApp, xlSheet)
  908. End If
  909. If Strings.Left(合約編號_tb.Text, 2) = "HX" Then : CC(xlApp, xlSheet) : Else : DD(xlApp, xlSheet) : End If : FF(xlApp, xlSheet)
  910. End If
  911. '----------------------------------------------------------------------------------------------------------------------
  912. If 主頁_ch.Checked = True Then
  913. xlSheet = NewMethod(xlBook) : xlApp.Sheets(1).Select : xlApp.Sheets(1).Name = "主頁"
  914. xlBook.Activate() : xlSheet.Activate()
  915. Dim BF As String : Dim CF As String
  916. If Strings.Left(合約編號_tb.Text, 2) = "HX" Then : BF = "PT HONG XHE INDUSTRIAL" & vbCrLf & "(鴻時工程有限公司)"
  917. Else : BF = "PT PUNCAK GEMILANG SEMESTA" & vbCrLf & "(鼎峰工程有限公司)" : End If
  918. If Label47.Text = 對話框(0) Then
  919. If 請款期數_cb.Text = "一" Then : CF = "第一次請款" & vbCrLf & "The First Installment of The Project Funds"
  920. ElseIf 請款期數_cb.Text = "二" Then : CF = "第二次請款" & vbCrLf & "The Second Installment of The Project Funds"
  921. ElseIf 請款期數_cb.Text = "三" Then : CF = "第三次請款" & vbCrLf & "The Third Installment of The Project Funds"
  922. ElseIf 請款期數_cb.Text = "四" Then : CF = "第四次請款" & vbCrLf & "The Fourth Installment of The Project Funds"
  923. ElseIf 請款期數_cb.Text = "五" Then : CF = "第五次請款" & vbCrLf & "The Fifth Installment of The Project Funds"
  924. End If
  925. Else
  926. If 請款_tb.Text = "1" Then : CF = "第一次請款" & vbCrLf & "The First Installment of The Project Funds"
  927. ElseIf 請款_tb.Text = "2" Then : CF = "第二次請款" & vbCrLf & "The Second Installment of The Project Funds"
  928. ElseIf 請款_tb.Text = "3" Then : CF = "第三次請款" & vbCrLf & "The Third Installment of The Project Funds"
  929. ElseIf 請款_tb.Text = "4" Then : CF = "第四次請款" & vbCrLf & "The Fourth Installment of The Project Funds"
  930. ElseIf 請款_tb.Text = "5" Then : CF = "第五次請款" & vbCrLf & "The Fifth Installment of The Project Funds"
  931. ElseIf 請款_tb.Text = "6" Then : CF = "第六次請款" & vbCrLf & "The Sixth Installment of The Project Funds"
  932. ElseIf 請款_tb.Text = "7" Then : CF = "第七次請款" & vbCrLf & "The Seventh Installment of The Project Funds"
  933. ElseIf 請款_tb.Text = "8" Then : CF = "第八次請款" & vbCrLf & "The Eighth Installment of The Project Funds"
  934. ElseIf 請款_tb.Text = "9" Then : CF = "第九次請款" & vbCrLf & "The Ninth Installment of The Project Funds"
  935. ElseIf 請款_tb.Text = "10" Then : CF = "第十次請款" & vbCrLf & "The Tenth Installment of The Project Funds"
  936. ElseIf 請款_tb.Text = "11" Then : CF = "第十一次請款" & vbCrLf & "The Eleventh Installment of The Project Funds"
  937. ElseIf 請款_tb.Text = "12" Then : CF = "第十二次請款" & vbCrLf & "The Twelfth Installment of The Project Funds"
  938. ElseIf 請款_tb.Text = "13" Then : CF = "第十三次請款" & vbCrLf & "The Thirteenth Installment of The Project Funds"
  939. ElseIf 請款_tb.Text = "14" Then : CF = "第十四次請款" & vbCrLf & "The Fourteenth Installment of The Project Funds"
  940. ElseIf 請款_tb.Text = "15" Then : CF = "第十五次請款" & vbCrLf & "The Fifteenth Installment of The Project Funds"
  941. ElseIf 請款_tb.Text = "16" Then : CF = "第十六次請款" & vbCrLf & "The Sixteenth Installment of The Project Funds"
  942. ElseIf 請款_tb.Text = "17" Then : CF = "第十七次請款" & vbCrLf & "The Seventeenth Installment of The Project Funds"
  943. ElseIf 請款_tb.Text = "18" Then : CF = "第十八次請款" & vbCrLf & "The Eighteenth Installment of The Project Funds"
  944. ElseIf 請款_tb.Text = "19" Then : CF = "第十九次請款" & vbCrLf & "The Nineteenth Installment of The Project Funds"
  945. ElseIf 請款_tb.Text = "20" Then : CF = "第二十次請款" & vbCrLf & "The Twentieth Installment of The Project Funds"
  946. ElseIf 請款_tb.Text = "21" Then : CF = "第二十一次請款" & vbCrLf & "The Twenty First Installment of The Project Funds"
  947. ElseIf 請款_tb.Text = "22" Then : CF = "第二十二次請款" & vbCrLf & "The Twenty Second Installment of The Project Funds"
  948. ElseIf 請款_tb.Text = "23" Then : CF = "第二十三次請款" & vbCrLf & "The Twenty Third Installment of The Project Funds"
  949. ElseIf 請款_tb.Text = "24" Then : CF = "第二十四次請款" & vbCrLf & "The Twenty Fourth Installment of The Project Funds"
  950. ElseIf 請款_tb.Text = "25" Then : CF = "第二十五次請款" & vbCrLf & "The Twenty Fifth Installment of The Project Funds"
  951. ElseIf 請款_tb.Text = "26" Then : CF = "第二十六次請款" & vbCrLf & "The Twenty Sixth Installment of The Project Funds"
  952. ElseIf 請款_tb.Text = "27" Then : CF = "第二十七次請款" & vbCrLf & "The Twenty Seventh Installment of The Project Funds"
  953. ElseIf 請款_tb.Text = "28" Then : CF = "第二十八次請款" & vbCrLf & "The Twenty Eighth Installment of The Project Funds"
  954. ElseIf 請款_tb.Text = "29" Then : CF = "第二十九次請款" & vbCrLf & "The Twenty Ninth Installment of The Project Funds"
  955. ElseIf 請款_tb.Text = "30" Then : CF = "第三十次請款" & vbCrLf & "The Thirtieth Installment of The Project Funds" : End If
  956. End If
  957. xlSheet.Cells(2, 1) = "工程款撥付申請表"
  958. xlSheet.Cells(3, 1) = "Form Request Pembayaran Proyek Pembangunan"
  959. xlSheet.Cells(4, 1) = "客戶名稱 : " & vbCrLf & "Client's Name" : xlSheet.Cells(4, 2) = 客戶名稱_tb.Text
  960. xlSheet.Cells(5, 1) = "工程名稱:" & vbCrLf & "Nama Proyek" : xlSheet.Cells(5, 2) = 工程名稱_中_tb.Text & vbCrLf & 工程名稱_英_tb.Text
  961. xlSheet.Cells(6, 1) = "施工合同號:" & vbCrLf & "No. Kontrak Konstruksi" : xlSheet.Cells(6, 2) = 合約編號_tb.Text
  962. xlSheet.Cells(7, 1) = "施工單位:" & vbCrLf & "Perusahaan Konstruksi" : xlSheet.Cells(7, 2) = BF
  963. xlSheet.Cells(8, 1) = "付款專案:" & vbCrLf & "Proyek Pembayaran" : xlSheet.Cells(8, 2) = CF
  964. xlSheet.Cells(8, 5) = "合同總額 (未稅):" & vbCrLf & "Jumlah Total Kontrak"
  965. If 稅額顯示_lb.Text = "PPN 10%稅額 = Rp. " Then
  966. xlSheet.Cells(8, 6) = Strings.Format(ANUD2.Value / 1.1, "#,##0")
  967. Else
  968. xlSheet.Cells(8, 6) = Strings.Format(ANUD2.Value / 1.11, "#,##0")
  969. End If
  970. xlSheet.Cells(9, 1) = "請款單位:" & vbCrLf & "Departemen Pemohon" : xlSheet.Cells(9, 2) = BF
  971. xlSheet.Cells(9, 5) = "要求付款日期:" & vbCrLf & "Permintaan Tanggal Pembayaran" : xlSheet.Cells(9, 6) = 付款期限_cb.Text
  972. xlSheet.Cells(10, 1) = "本次請款金額 (未稅):" & vbCrLf & "Total Tagihan" : xlSheet.Cells(10, 2) = Strings.Format(請款金額_nud.Value, "#,##0")
  973. xlSheet.Cells(10, 5) = "累計已收金額 (未稅):" & vbCrLf & "Akumulasi Biaya yang Diterima"
  974. Dim 已請 As Long
  975. For I As Integer = 0 To 請款單_dgv.Rows.Count - 1
  976. If Label47.Text = 對話框(0) Then
  977. If 請款期數_cb.Text = "一" Then : 已請 = 0
  978. ElseIf 請款期數_cb.Text = "二" Then
  979. If 請款單_dgv.Rows(I).Cells(表頭(6)).Value.ToString = "一" Then : 已請 += 請款單_dgv.Rows(I).Cells(表頭(8)).Value
  980. End If
  981. ElseIf 請款期數_cb.Text = "三" Then
  982. If 請款單_dgv.Rows(I).Cells(表頭(6)).Value.ToString = "一" Or 請款單_dgv.Rows(I).Cells(表頭(6)).Value.ToString = "二" Then
  983. 已請 += 請款單_dgv.Rows(I).Cells(表頭(8)).Value
  984. End If
  985. ElseIf 請款期數_cb.Text = "四" Then
  986. If 請款單_dgv.Rows(I).Cells(表頭(6)).Value.ToString = "一" Or 請款單_dgv.Rows(I).Cells(表頭(6)).Value.ToString = "二" Or
  987. 請款單_dgv.Rows(I).Cells(表頭(6)).Value.ToString = "三" Then : 已請 += 請款單_dgv.Rows(I).Cells(表頭(8)).Value
  988. End If
  989. ElseIf 請款期數_cb.Text = "五" Then
  990. If 請款單_dgv.Rows(I).Cells(表頭(6)).Value.ToString = "一" Or 請款單_dgv.Rows(I).Cells(表頭(6)).Value.ToString = "二" Or
  991. 請款單_dgv.Rows(I).Cells(表頭(6)).Value.ToString = "三" Or 請款單_dgv.Rows(I).Cells(表頭(6)).Value.ToString = "四" Then
  992. 已請 += 請款單_dgv.Rows(I).Cells(表頭(8)).Value
  993. End If
  994. End If
  995. Else
  996. If CInt(請款_tb.Text) = 1 Then : 已請 = 0
  997. ElseIf CInt(請款單_dgv.Rows(I).Cells("分期").Value.ToString) < CInt(請款_tb.Text) Then
  998. 已請 += 請款單_dgv.Rows(I).Cells(表頭(8)).Value
  999. End If
  1000. End If
  1001. Next
  1002. xlSheet.Cells(10, 6) = Strings.Format(已請, "#,##0")
  1003. xlSheet.Cells(11, 1) = "本次請款內容:" & vbCrLf & "Deskripsi Tagihan" : xlSheet.Cells(11, 2) = 請款內容_tb.Text
  1004. If 主頁明細_ch.Checked = True Then
  1005. xlSheet.Cells(14, 2) = "合約金額(Contract Amount) : "
  1006. If 稅額顯示_lb.Text = "PPN 10%稅額 = Rp. " Then
  1007. xlSheet.Cells(14, 4) = Strings.Format(ANUD1.Value / 1.1, "#,##0")
  1008. Else
  1009. xlSheet.Cells(14, 4) = Strings.Format(ANUD1.Value / 1.11, "#,##0")
  1010. End If : xlSheet.Cells(14, 5) = " RP (未稅)"
  1011. xlSheet.Cells(15, 2) = "結算金額(Settlement Amount) : "
  1012. If 稅額顯示_lb.Text = "PPN 10%稅額 = Rp. " Then
  1013. xlSheet.Cells(15, 4) = Strings.Format(ANUD2.Value / 1.1, "#,##0")
  1014. Else
  1015. xlSheet.Cells(15, 4) = Strings.Format(ANUD2.Value / 1.11, "#,##0")
  1016. End If : xlSheet.Cells(15, 5) = " RP (未稅)"
  1017. xlSheet.Cells(16, 2) = "實際追加減(Add To) : "
  1018. If 稅額顯示_lb.Text = "PPN 10%稅額 = Rp. " Then
  1019. xlSheet.Cells(16, 4) = Strings.Format(ANUD3.Value / 1.1, "#,##0")
  1020. Else
  1021. xlSheet.Cells(16, 4) = Strings.Format(ANUD3.Value / 1.11, "#,##0")
  1022. End If : xlSheet.Cells(16, 5) = " RP (未稅)"
  1023. xlSheet.Cells(17, 2) = "已請款(Requested) : " : xlSheet.Cells(17, 4) = Strings.Format(已請, "#,##0") : xlSheet.Cells(17, 5) = " RP (未稅)"
  1024. xlSheet.Cells(18, 2) = "剩餘款(Remaining) : " : xlSheet.Cells(18, 4) = "=D15-D17" : xlSheet.Cells(18, 5) = " RP (未稅)"
  1025. xlSheet.Cells(19, 2) = "其中:"
  1026. If 請款期數_cb.Text = "四" Then : xlSheet.Cells(20, 2) = "驗收款(Final acceptance) : " : Else : xlSheet.Cells(20, 2) = "未收款(Unpaid) : " : End If
  1027. xlSheet.Cells(20, 4) = "=D15-D17-D21" : xlSheet.Cells(20, 5) = " RP (未稅)"
  1028. xlSheet.Cells(21, 2) = "保留款(Assure) : " : xlSheet.Cells(21, 4) = "= D15 * " & 工程款5_nud.Value & "/ 100" : xlSheet.Cells(21, 5) = " RP (未稅)"
  1029. End If
  1030. xlSheet.Cells(23, 3) = "申請人 Pemohon:" : xlSheet.Cells(23, 4) = BF
  1031. xlSheet.Cells(25, 3) = "申請時間 Waktu:" : xlSheet.Cells(25, 4) = Strings.Format(申請日期_dtp.Value, "yyyy/MM/dd")
  1032. xlSheet.Cells(26, 1) = "籌建辦審批意見:" & vbCrLf & "Komentar Penyetuju Kantor Konstruksi Umum" : xlSheet.Cells(26, 2) = 其他意見_tb.Text
  1033. xlSheet.Cells(36, 3) = "審核人 Disetujui oleh:" : xlSheet.Cells(37, 3) = "審核時間 Waktu:"
  1034. xlSheet.Cells(39, 1) = "本表一式三份:施工單位、籌建辦、財務單位各一份。"
  1035. xlSheet.Cells(40, 1) = "Form ini dirangkap 3 lembar: Perusahaan konstruksi, kantor konstruksi umum, departemen finance"
  1036. AA(xlApp, xlSheet)
  1037. If 甲方_tb.Text = "JCS" Then : JCS(xlApp, xlSheet) : ElseIf 甲方_tb.Text = "J2" Then : J2(xlApp, xlSheet) : Else
  1038. If Strings.Left(合約編號_tb.Text, 2) = "HX" Then : CC(xlApp, xlSheet) : Else : DD(xlApp, xlSheet) : End If : FF(xlApp, xlSheet)
  1039. End If
  1040. End If
  1041. Dim SERT As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
  1042. '-------------轉換成PDF---------------------------------------------------------------------
  1043. If 報告移交單_ch.Checked = True And 請款單_ch.Checked = True And 主頁_ch.Checked = True Then : xlApp.Sheets(4).Delete
  1044. xlBook.Sheets(1).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, SERT & "\" & 合約編號_tb.Text & "_X1.pdf", XlFixedFormatQuality.xlQualityStandard, True)
  1045. xlBook.Sheets(2).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, SERT & "\" & 合約編號_tb.Text & "_X2.pdf", XlFixedFormatQuality.xlQualityStandard, True)
  1046. xlBook.Sheets(3).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, SERT & "\" & 合約編號_tb.Text & "_X3.pdf", XlFixedFormatQuality.xlQualityStandard, True)
  1047. Dim pdf1 As String = SERT & "\" & 合約編號_tb.Text & "_X1.pdf"
  1048. Dim pdf2 As String = SERT & "\" & 合約編號_tb.Text & "_X2.pdf"
  1049. Dim pdf3 As String = SERT & "\" & 合約編號_tb.Text & "_X3.pdf"
  1050. Dim outputPDF As String = SERT & "\" & 合約編號_tb.Text & "請款單.pdf"
  1051. Dim mergedDocument As New PdfDocument() ' 创建一个新的PDF文档对象
  1052. Dim document1 As PdfDocument = PdfReader.Open(pdf1, PdfDocumentOpenMode.Import) ' 打开第一个PDF文件
  1053. For Each page As PdfPage In document1.Pages : mergedDocument.AddPage(page) : Next ' 将第一个PDF文件的页面逐一添加到合并文档
  1054. Dim document2 As PdfDocument = PdfReader.Open(pdf2, PdfDocumentOpenMode.Import) ' 打开第二个PDF文件
  1055. For Each page As PdfPage In document2.Pages : mergedDocument.AddPage(page) : Next ' 将第二个PDF文件的页面逐一添加到合并文档
  1056. Dim document3 As PdfDocument = PdfReader.Open(pdf3, PdfDocumentOpenMode.Import) ' 打开第三个PDF文件
  1057. For Each page As PdfPage In document3.Pages : mergedDocument.AddPage(page) : Next ' 将第三个PDF文件的页面逐一添加到合并文档
  1058. mergedDocument.Save(outputPDF) ' 保存合并后的PDF文件
  1059. document1.Close() : document2.Close() : document3.Close() ' 关闭文档对象
  1060. File.Delete(SERT & "\" & 合約編號_tb.Text & "_X1.pdf")
  1061. File.Delete(SERT & "\" & 合約編號_tb.Text & "_X2.pdf")
  1062. File.Delete(SERT & "\" & 合約編號_tb.Text & "_X3.pdf") ' 删除文件1和文件2
  1063. ElseIf 報告移交單_ch.Checked = True And 請款單_ch.Checked = True And 主頁_ch.Checked = False Then : xlApp.Sheets(3).Delete
  1064. xlBook.Sheets(1).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, SERT & "\" & 合約編號_tb.Text & "_X1.pdf", XlFixedFormatQuality.xlQualityStandard, True)
  1065. xlBook.Sheets(2).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, SERT & "\" & 合約編號_tb.Text & "_X2.pdf", XlFixedFormatQuality.xlQualityStandard, True)
  1066. Dim pdf1 As String = SERT & "\" & 合約編號_tb.Text & "_X1.pdf" : Dim pdf2 As String = SERT & "\" & 合約編號_tb.Text & "_X2.pdf"
  1067. Dim outputPDF As String = SERT & "\" & 合約編號_tb.Text & "請款單.pdf"
  1068. Dim mergedDocument As New PdfDocument() ' 创建一个新的PDF文档对象
  1069. Dim document1 As PdfDocument = PdfReader.Open(pdf1, PdfDocumentOpenMode.Import) ' 打开第一个PDF文件
  1070. For Each page As PdfPage In document1.Pages : mergedDocument.AddPage(page) : Next ' 将第一个PDF文件的页面逐一添加到合并文档
  1071. Dim document2 As PdfDocument = PdfReader.Open(pdf2, PdfDocumentOpenMode.Import) ' 打开第二个PDF文件
  1072. For Each page As PdfPage In document2.Pages : mergedDocument.AddPage(page) : Next ' 将第二个PDF文件的页面逐一添加到合并文档
  1073. mergedDocument.Save(outputPDF) ' 保存合并后的PDF文件
  1074. document1.Close() : document2.Close() ' 关闭文档对象
  1075. File.Delete(SERT & "\" & 合約編號_tb.Text & "_X1.pdf") : File.Delete(SERT & "\" & 合約編號_tb.Text & "_X2.pdf") ' 删除文件1和文件2
  1076. ElseIf 報告移交單_ch.Checked = True And 請款單_ch.Checked = False And 主頁_ch.Checked = True Then : xlApp.Sheets(3).Delete
  1077. xlBook.Sheets(1).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, SERT & "\" & 合約編號_tb.Text & "_X1.pdf", XlFixedFormatQuality.xlQualityStandard, True)
  1078. xlBook.Sheets(2).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, SERT & "\" & 合約編號_tb.Text & "_X2.pdf", XlFixedFormatQuality.xlQualityStandard, True)
  1079. Dim pdf1 As String = SERT & "\" & 合約編號_tb.Text & "_X1.pdf" : Dim pdf2 As String = SERT & "\" & 合約編號_tb.Text & "_X2.pdf"
  1080. Dim outputPDF As String = SERT & "\" & 合約編號_tb.Text & "請款單.pdf"
  1081. Dim mergedDocument As New PdfDocument() ' 创建一个新的PDF文档对象
  1082. Dim document1 As PdfDocument = PdfReader.Open(pdf1, PdfDocumentOpenMode.Import) ' 打开第一个PDF文件
  1083. For Each page As PdfPage In document1.Pages : mergedDocument.AddPage(page) : Next ' 将第一个PDF文件的页面逐一添加到合并文档
  1084. Dim document2 As PdfDocument = PdfReader.Open(pdf2, PdfDocumentOpenMode.Import) ' 打开第二个PDF文件
  1085. For Each page As PdfPage In document2.Pages : mergedDocument.AddPage(page) : Next ' 将第二个PDF文件的页面逐一添加到合并文档
  1086. mergedDocument.Save(outputPDF) ' 保存合并后的PDF文件
  1087. document1.Close() : document2.Close() ' 关闭文档对象
  1088. File.Delete(SERT & "\" & 合約編號_tb.Text & "_X1.pdf") : File.Delete(SERT & "\" & 合約編號_tb.Text & "_X2.pdf") ' 删除文件1和文件2
  1089. ElseIf 報告移交單_ch.Checked = False And 請款單_ch.Checked = True And 主頁_ch.Checked = True Then : xlApp.Sheets(3).Delete
  1090. xlBook.Sheets(1).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, SERT & "\" & 合約編號_tb.Text & "_X1.pdf", XlFixedFormatQuality.xlQualityStandard, True)
  1091. xlBook.Sheets(2).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, SERT & "\" & 合約編號_tb.Text & "_X2.pdf", XlFixedFormatQuality.xlQualityStandard, True)
  1092. Dim pdf1 As String = SERT & "\" & 合約編號_tb.Text & "_X1.pdf" : Dim pdf2 As String = SERT & "\" & 合約編號_tb.Text & "_X2.pdf"
  1093. Dim outputPDF As String = SERT & "\" & 合約編號_tb.Text & "請款單.pdf"
  1094. Dim mergedDocument As New PdfDocument() ' 创建一个新的PDF文档对象
  1095. Dim document1 As PdfDocument = PdfReader.Open(pdf1, PdfDocumentOpenMode.Import) ' 打开第一个PDF文件
  1096. For Each page As PdfPage In document1.Pages : mergedDocument.AddPage(page) : Next ' 将第一个PDF文件的页面逐一添加到合并文档
  1097. Dim document2 As PdfDocument = PdfReader.Open(pdf2, PdfDocumentOpenMode.Import) ' 打开第二个PDF文件
  1098. For Each page As PdfPage In document2.Pages : mergedDocument.AddPage(page) : Next ' 将第二个PDF文件的页面逐一添加到合并文档
  1099. mergedDocument.Save(outputPDF) ' 保存合并后的PDF文件
  1100. document1.Close() : document2.Close() ' 关闭文档对象
  1101. File.Delete(SERT & "\" & 合約編號_tb.Text & "_X1.pdf") : File.Delete(SERT & "\" & 合約編號_tb.Text & "_X2.pdf") ' 删除文件1和文件2
  1102. ElseIf 報告移交單_ch.Checked = True And 請款單_ch.Checked = False And 主頁_ch.Checked = False Then : xlApp.Sheets(2).Delete
  1103. xlBook.Sheets(1).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, SERT & "\" & 合約編號_tb.Text & "報告移交單.pdf", XlFixedFormatQuality.xlQualityStandard, True)
  1104. ElseIf 報告移交單_ch.Checked = False And 請款單_ch.Checked = True And 主頁_ch.Checked = False Then : xlApp.Sheets(2).Delete
  1105. xlBook.Sheets(1).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, SERT & "\" & 合約編號_tb.Text & "請款明細表.pdf", XlFixedFormatQuality.xlQualityStandard, True)
  1106. ElseIf 報告移交單_ch.Checked = False And 請款單_ch.Checked = False And 主頁_ch.Checked = True Then : xlApp.Sheets(2).Delete
  1107. xlBook.Sheets(1).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, SERT & "\" & 合約編號_tb.Text & "工程款撥付申請表.pdf", XlFixedFormatQuality.xlQualityStandard, True)
  1108. End If
  1109. '-------------關閉EXCEL---------------------------------------------------------------------
  1110. xlSheet.PageSetup.PrintArea = "" : xlApp.Cells.Select()
  1111. xlApp.Application.WindowState = xlMinimized
  1112. xlBook.Close(False)
  1113. Runtime.InteropServices.Marshal.ReleaseComObject(xlSheet)
  1114. Runtime.InteropServices.Marshal.ReleaseComObject(xlBook)
  1115. Runtime.InteropServices.Marshal.ReleaseComObject(xlApp)
  1116. xlApp.Quit() : xlSheet = Nothing : xlBook = Nothing : xlApp = Nothing : GC.Collect()
  1117. '-------------開啟PDF---------------------------------------------------------------------
  1118. Dim pdfFilePath As String
  1119. If 報告移交單_ch.Checked = True And 請款單_ch.Checked = False And 主頁_ch.Checked = False Then
  1120. pdfFilePath = SERT & "\" & 合約編號_tb.Text & "報告移交單.pdf"
  1121. ElseIf 報告移交單_ch.Checked = False And 請款單_ch.Checked = True And 主頁_ch.Checked = False Then
  1122. pdfFilePath = SERT & "\" & 合約編號_tb.Text & "請款明細表.pdf"
  1123. ElseIf 報告移交單_ch.Checked = False And 請款單_ch.Checked = False And 主頁_ch.Checked = True Then
  1124. pdfFilePath = SERT & "\" & 合約編號_tb.Text & "工程款撥付申請表.pdf"
  1125. Else
  1126. pdfFilePath = SERT & "\" & 合約編號_tb.Text & "請款單.pdf"
  1127. End If
  1128. If IsChromeInstalled() Then
  1129. Try
  1130. Dim chromeProcess As New Process()
  1131. chromeProcess.StartInfo.FileName = "chrome"
  1132. chromeProcess.StartInfo.Arguments = """" & pdfFilePath & """"
  1133. chromeProcess.Start()
  1134. Catch ex As Exception
  1135. End Try
  1136. Else
  1137. Try
  1138. System.Diagnostics.Process.Start("""" & pdfFilePath & """")
  1139. Catch ex As Exception
  1140. End Try
  1141. End If
  1142. MGB(系統語言字典("H508-121-" & 語言), 1)
  1143. Catch ex As Exception
  1144. MGB(ex.Message, 1)
  1145. End Try
  1146. End If
  1147. End If
  1148. End If
  1149. End If
  1150. End If
  1151. End Sub
  1152. ' 檢查系統是否已安裝 Google Chrome
  1153. Private Function IsChromeInstalled() As Boolean
  1154. Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
  1155. If key IsNot Nothing Then
  1156. For Each subkeyName As String In key.GetSubKeyNames()
  1157. Dim subkey As Microsoft.Win32.RegistryKey = key.OpenSubKey(subkeyName)
  1158. Dim displayName As Object = subkey.GetValue("DisplayName")
  1159. If displayName IsNot Nothing AndAlso displayName.ToString().Contains("Google Chrome") Then
  1160. Return True
  1161. End If
  1162. Next
  1163. End If
  1164. Return False
  1165. End Function
  1166. Private Sub 客戶名稱_tb_Click(sender As Object, e As EventArgs) Handles 客戶名稱_tb.Click
  1167. CB選擇清單(客戶名稱_tb)
  1168. End Sub
  1169. Private Sub 付款期限_cb_Click(sender As Object, e As EventArgs) Handles 付款期限_cb.Click
  1170. CB選擇清單(付款期限_cb)
  1171. End Sub
  1172. Private Shared Function NewMethod(xlBook As Workbook) As Worksheet
  1173. Return CType(xlBook.Worksheets.Add, Worksheet)
  1174. End Function
  1175. Private Sub AA(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1176. xlSheet.Cells.Select()
  1177. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 10 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1178. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1179. xlSheet.Rows("1:1").Select : myExcel.Selection.RowHeight = 95
  1180. xlSheet.Rows("2:3").Select
  1181. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 18 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1182. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1183. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 30 : xlSheet.Columns("B:D").Select : myExcel.Selection.ColumnWidth = 15
  1184. xlSheet.Columns("E:E").Select : myExcel.Selection.ColumnWidth = 30 : xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 15
  1185. xlSheet.Rows("4:7").Select : myExcel.Selection.RowHeight = 40
  1186. xlSheet.Range("B4:F4").Select()
  1187. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1188. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1189. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1190. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1191. xlSheet.Range("B5:F5").Select() : With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False
  1192. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1193. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1194. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1195. xlSheet.Range("B6:F6").Select()
  1196. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1197. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1198. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1199. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1200. xlSheet.Range("B7:F7").Select()
  1201. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1202. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1203. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1204. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1205. xlSheet.Range("A2:F2").Select()
  1206. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1207. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1208. xlSheet.Range("A3:F3").Select()
  1209. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1210. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1211. xlSheet.Rows("8:10").Select : myExcel.Selection.RowHeight = 40
  1212. xlSheet.Range("B8:D8").Select()
  1213. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1214. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1215. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1216. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1217. xlSheet.Range("B9:D9").Select()
  1218. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1219. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1220. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1221. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1222. xlSheet.Range("B10:D10").Select()
  1223. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1224. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1225. xlSheet.Range("F8:F10").Select()
  1226. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1227. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1228. xlSheet.Range("B11:F12").Select()
  1229. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1230. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1231. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1232. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1233. xlSheet.Range("A11:A25").Select()
  1234. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1235. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1236. xlSheet.Range("D24:F24").Select()
  1237. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1238. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1239. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1240. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1241. xlSheet.Rows("24:24").Select : myExcel.Selection.RowHeight = 13.5
  1242. xlSheet.Range("C24").Select()
  1243. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1244. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1245. xlSheet.Range("C25").Select()
  1246. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1247. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1248. xlSheet.Range("D25").Select()
  1249. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1250. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1251. xlSheet.Rows("26:26").Select : myExcel.Selection.RowHeight = 13.5
  1252. xlSheet.Range("A26:A37").Select()
  1253. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1254. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1255. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1256. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1257. xlSheet.Range("A11:A25").Select()
  1258. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1259. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1260. xlSheet.Range("B26:F35").Select()
  1261. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1262. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1263. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1264. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1265. xlSheet.Range("C36").Select()
  1266. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1267. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1268. xlSheet.Range("C37").Select()
  1269. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1270. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1271. xlSheet.Range("A4:F10").Select()
  1272. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1273. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1274. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1275. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1276. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1277. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1278. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1279. xlSheet.Range("B11:F25").Select()
  1280. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1281. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1282. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1283. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1284. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1285. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1286. xlSheet.Range("A11:A25").Select()
  1287. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1288. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1289. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1290. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1291. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1292. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1293. xlSheet.Range("A26:A37").Select()
  1294. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1295. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1296. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1297. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1298. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1299. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1300. xlSheet.Range("B26:F37").Select()
  1301. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1302. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1303. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1304. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1305. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1306. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1307. xlSheet.Range("A4:F37").Select()
  1308. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1309. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1310. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1311. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1312. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1313. xlSheet.Range("A38:F41").Select()
  1314. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1315. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1316. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1317. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1318. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1319. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1320. myExcel.ActiveWindow.DisplayGridlines = False
  1321. xlSheet.Range("D23:F24").Select()
  1322. With myExcel.Selection : .HorizontalAlignment = xlGeneral : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1323. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.UnMerge
  1324. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1325. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1326. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1327. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1328. xlSheet.Range("D21").Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1329. xlSheet.Range("I6").Select()
  1330. End Sub
  1331. Private Sub BB(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1332. xlSheet.Cells.Select()
  1333. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 10 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1334. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1335. xlSheet.Range("D15:F18").Select()
  1336. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 14 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1337. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1338. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 5 : xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 40
  1339. xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 17
  1340. xlSheet.Columns("E:E").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 17
  1341. xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("H:H").Select : myExcel.Selection.ColumnWidth = 17
  1342. xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 10
  1343. xlSheet.Rows("1:1").Select : myExcel.Selection.RowHeight = 95 : xlSheet.Rows("3:3").Select : myExcel.Selection.RowHeight = 30
  1344. xlSheet.Rows("4:4").Select : myExcel.Selection.RowHeight = 50 : xlSheet.Rows("5:5").Select : myExcel.Selection.RowHeight = 25
  1345. xlSheet.Rows("7:7").Select : myExcel.Selection.RowHeight = 40 : xlSheet.Rows("8:12").Select : myExcel.Selection.RowHeight = 30
  1346. xlSheet.Rows("13:13").Select : myExcel.Selection.RowHeight = 30 : xlSheet.Rows("14:21").Select : myExcel.Selection.RowHeight = 30
  1347. xlSheet.Rows("23:23").Select : myExcel.Selection.RowHeight = 120
  1348. xlSheet.Range("A2:I2").Select()
  1349. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1350. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1351. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 22 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1352. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1353. myExcel.Selection.Font.Underline = xlUnderlineStyleSingle
  1354. xlSheet.Range("A3:G3").Select()
  1355. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1356. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1357. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1358. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1359. xlSheet.Range("H3:I3").Select()
  1360. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1361. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1362. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1363. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1364. xlSheet.Range("A4:G4").Select()
  1365. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1366. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1367. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1368. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1369. With myExcel.Selection : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  1370. .ReadingOrder = xlContext : End With
  1371. xlSheet.Range("H4:I4").Select()
  1372. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1373. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1374. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1375. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1376. xlSheet.Range("A5:D5").Select()
  1377. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1378. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1379. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1380. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1381. xlSheet.Range("E5:I5").Select()
  1382. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1383. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1384. myExcel.Selection.NumberFormatLocal = "#,##0"
  1385. xlSheet.Range("E7:F7").Select()
  1386. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1387. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1388. xlSheet.Range("G7:H7").Select()
  1389. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1390. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1391. xlSheet.Range("A7:I7").Select()
  1392. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1393. .ShrinkToFit = False : .ReadingOrder = xlContext : End With
  1394. xlSheet.Range("A8:A12").Select()
  1395. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1396. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1397. xlSheet.Range("A8:B12").Select()
  1398. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1399. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1400. xlSheet.Range("C8:C12").Select() : myExcel.Selection.Style = "Percent"
  1401. xlSheet.Range("E8:E13").Select() : myExcel.Selection.Style = "Percent"
  1402. xlSheet.Range("G8:G13").Select() : myExcel.Selection.Style = "Percent"
  1403. xlSheet.Range("D8:D18").Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1404. xlSheet.Range("F8:F13").Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1405. xlSheet.Range("H8:H13").Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1406. xlSheet.Range("A13:C13").Select()
  1407. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1408. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1409. xlSheet.Range("B15:B16").Select()
  1410. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1411. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1412. xlSheet.Range("D15:E15").Select()
  1413. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1414. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1415. xlSheet.Range("D16:E16").Select()
  1416. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1417. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1418. xlSheet.Range("D17:E17").Select()
  1419. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1420. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1421. xlSheet.Range("D18:F18").Select()
  1422. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1423. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1424. xlSheet.Range("B21:D21").Select()
  1425. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1426. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1427. xlSheet.Range("B22:D22").Select()
  1428. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1429. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1430. xlSheet.Range("A3:I4").Select()
  1431. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1432. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1433. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1434. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1435. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1436. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1437. xlSheet.Range("A5:I5").Select()
  1438. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1439. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1440. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1441. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1442. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1443. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1444. xlSheet.Range("A7:I7").Select()
  1445. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1446. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1447. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1448. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1449. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1450. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1451. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1452. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1453. xlSheet.Range("A8:I12").Select()
  1454. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1455. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1456. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1457. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1458. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1459. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1460. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1461. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1462. xlSheet.Range("A13:I13").Select()
  1463. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1464. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1465. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1466. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1467. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1468. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1469. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1470. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1471. xlSheet.Range("B16:E16").Select()
  1472. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1473. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1474. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1475. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1476. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1477. xlSheet.Range("D18:F18").Select()
  1478. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1479. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1480. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1481. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1482. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1483. xlSheet.Range("A14:I23").Select()
  1484. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1485. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1486. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1487. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1488. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1489. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1490. xlSheet.Range("J16").Select() : myExcel.ActiveWindow.DisplayGridlines = False
  1491. xlSheet.Range("C7:D12").Select() : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent6 : .TintAndShade = 0 : End With
  1492. xlSheet.Range("D13").Select() : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent6 : .TintAndShade = 0 : End With
  1493. xlSheet.Range("E7:F13").Select() : With myExcel.Selection.Font : .Color = -16776961 : .TintAndShade = 0 : End With
  1494. xlSheet.Range("G7:H13").Select() : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent1 : .TintAndShade = 0 : End With
  1495. xlSheet.Range("A7:I13").Select() : myExcel.Selection.Font.Bold = True
  1496. xlSheet.Columns("J:J").Select : With myExcel.Selection.Font : .ThemeColor = xlThemeColorDark1 : .TintAndShade = 0 : End With
  1497. xlSheet.Columns("J:J").Select : myExcel.Selection.ColumnWidth = 0.5
  1498. End Sub
  1499. Private Sub BB2(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1500. xlSheet.Cells.Select()
  1501. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 10 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1502. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1503. xlSheet.Range("D14:F17").Select()
  1504. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 14 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1505. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1506. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 5 : xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 40
  1507. xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 17
  1508. xlSheet.Columns("E:E").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 17
  1509. xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("H:H").Select : myExcel.Selection.ColumnWidth = 17
  1510. xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 10
  1511. xlSheet.Rows("1:1").Select : myExcel.Selection.RowHeight = 95 : xlSheet.Rows("3:3").Select : myExcel.Selection.RowHeight = 30
  1512. xlSheet.Rows("4:4").Select : myExcel.Selection.RowHeight = 50 : xlSheet.Rows("5:5").Select : myExcel.Selection.RowHeight = 25
  1513. xlSheet.Rows("7:7").Select : myExcel.Selection.RowHeight = 40 : xlSheet.Rows("8:11").Select : myExcel.Selection.RowHeight = 30
  1514. xlSheet.Rows("12:12").Select : myExcel.Selection.RowHeight = 30 : xlSheet.Rows("13:20").Select : myExcel.Selection.RowHeight = 30
  1515. xlSheet.Rows("22:22").Select : myExcel.Selection.RowHeight = 120
  1516. xlSheet.Range("A2:I2").Select()
  1517. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1518. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1519. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 22 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1520. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1521. myExcel.Selection.Font.Underline = xlUnderlineStyleSingle
  1522. xlSheet.Range("A3:G3").Select()
  1523. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1524. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1525. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1526. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1527. xlSheet.Range("H3:I3").Select()
  1528. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1529. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1530. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1531. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1532. xlSheet.Range("A4:G4").Select()
  1533. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1534. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1535. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1536. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1537. With myExcel.Selection : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  1538. .ReadingOrder = xlContext : End With
  1539. xlSheet.Range("H4:I4").Select()
  1540. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1541. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1542. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1543. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1544. xlSheet.Range("A5:D5").Select()
  1545. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1546. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1547. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1548. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1549. xlSheet.Range("E5:I5").Select()
  1550. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1551. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1552. myExcel.Selection.NumberFormatLocal = "#,##0"
  1553. xlSheet.Range("E7:F7").Select()
  1554. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1555. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1556. xlSheet.Range("G7:H7").Select()
  1557. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1558. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1559. xlSheet.Range("A7:I7").Select()
  1560. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1561. .ShrinkToFit = False : .ReadingOrder = xlContext : End With
  1562. xlSheet.Range("A8:A11").Select()
  1563. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1564. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1565. xlSheet.Range("A8:B11").Select()
  1566. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1567. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1568. xlSheet.Range("C8:C11").Select() : myExcel.Selection.Style = "Percent"
  1569. xlSheet.Range("E8:E12").Select() : myExcel.Selection.Style = "Percent"
  1570. xlSheet.Range("G8:G12").Select() : myExcel.Selection.Style = "Percent"
  1571. xlSheet.Range("D8:D17").Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1572. xlSheet.Range("F8:F12").Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1573. xlSheet.Range("H8:H12").Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1574. xlSheet.Range("A12:C12").Select()
  1575. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1576. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1577. xlSheet.Range("B14:B15").Select()
  1578. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1579. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1580. xlSheet.Range("D14:E14").Select()
  1581. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1582. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1583. xlSheet.Range("D15:E15").Select()
  1584. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1585. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1586. xlSheet.Range("D16:E16").Select()
  1587. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1588. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1589. xlSheet.Range("D17:F17").Select()
  1590. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1591. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1592. xlSheet.Range("B20:D20").Select()
  1593. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1594. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1595. xlSheet.Range("B21:D21").Select()
  1596. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1597. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1598. xlSheet.Range("A3:I4").Select()
  1599. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1600. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1601. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1602. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1603. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1604. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1605. xlSheet.Range("A5:I5").Select()
  1606. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1607. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1608. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1609. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1610. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1611. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1612. xlSheet.Range("A7:I7").Select()
  1613. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1614. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1615. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1616. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1617. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1618. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1619. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1620. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1621. xlSheet.Range("A8:I11").Select()
  1622. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1623. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1624. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1625. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1626. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1627. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1628. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1629. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1630. xlSheet.Range("A12:I12").Select()
  1631. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1632. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1633. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1634. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1635. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1636. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1637. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1638. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1639. xlSheet.Range("B15:E15").Select()
  1640. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1641. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1642. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1643. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1644. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1645. xlSheet.Range("D17:F17").Select()
  1646. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1647. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1648. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1649. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1650. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1651. xlSheet.Range("A13:I22").Select()
  1652. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1653. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1654. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1655. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1656. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1657. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1658. xlSheet.Range("J16").Select() : myExcel.ActiveWindow.DisplayGridlines = False
  1659. xlSheet.Range("C7:D11").Select() : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent6 : .TintAndShade = 0 : End With
  1660. xlSheet.Range("D12").Select() : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent6 : .TintAndShade = 0 : End With
  1661. xlSheet.Range("E7:F12").Select() : With myExcel.Selection.Font : .Color = -16776961 : .TintAndShade = 0 : End With
  1662. xlSheet.Range("G7:H12").Select() : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent1 : .TintAndShade = 0 : End With
  1663. xlSheet.Range("A7:I12").Select() : myExcel.Selection.Font.Bold = True
  1664. xlSheet.Columns("J:J").Select : With myExcel.Selection.Font : .ThemeColor = xlThemeColorDark1 : .TintAndShade = 0 : End With
  1665. xlSheet.Columns("J:J").Select : myExcel.Selection.ColumnWidth = 0.5
  1666. End Sub
  1667. Private Sub BB3(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1668. xlSheet.Cells.Select()
  1669. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 10 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1670. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1671. xlSheet.Range("D" & DF + 2 & ":F" & DF + 5 & "").Select()
  1672. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 14 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1673. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1674. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 5 : xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 40
  1675. xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 17
  1676. xlSheet.Columns("E:E").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 17
  1677. xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("H:H").Select : myExcel.Selection.ColumnWidth = 17
  1678. xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 10
  1679. xlSheet.Rows("1:1").Select : myExcel.Selection.RowHeight = 95 : xlSheet.Rows("3:3").Select : myExcel.Selection.RowHeight = 30
  1680. xlSheet.Rows("4:4").Select : myExcel.Selection.RowHeight = 50 : xlSheet.Rows("5:5").Select : myExcel.Selection.RowHeight = 25
  1681. xlSheet.Rows("7:7").Select : myExcel.Selection.RowHeight = 40 : xlSheet.Rows("8:" & DF - 1).Select : myExcel.Selection.RowHeight = 30
  1682. xlSheet.Rows(DF & ":" & DF).Select : myExcel.Selection.RowHeight = 30 : xlSheet.Rows(DF + 1 & ":" & DF + 8).Select : myExcel.Selection.RowHeight = 30
  1683. xlSheet.Rows(DF + 10 & ":" & DF + 10).Select : myExcel.Selection.RowHeight = 120
  1684. xlSheet.Range("A2:I2").Select()
  1685. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1686. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1687. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 22 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1688. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1689. myExcel.Selection.Font.Underline = xlUnderlineStyleSingle
  1690. xlSheet.Range("A3:G3").Select()
  1691. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1692. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1693. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1694. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1695. xlSheet.Range("H3:I3").Select()
  1696. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1697. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1698. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1699. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1700. xlSheet.Range("A4:G4").Select()
  1701. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1702. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1703. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1704. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1705. With myExcel.Selection : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  1706. .ReadingOrder = xlContext : End With
  1707. xlSheet.Range("H4:I4").Select()
  1708. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1709. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1710. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1711. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1712. xlSheet.Range("A5:D5").Select()
  1713. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1714. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1715. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1716. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1717. xlSheet.Range("E5:I5").Select()
  1718. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1719. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1720. myExcel.Selection.NumberFormatLocal = "#,##0"
  1721. xlSheet.Range("E7:F7").Select()
  1722. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1723. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1724. xlSheet.Range("G7:H7").Select()
  1725. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1726. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1727. xlSheet.Range("A7:I7").Select()
  1728. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1729. .ShrinkToFit = False : .ReadingOrder = xlContext : End With
  1730. xlSheet.Range("A8:A" & DF - 1).Select()
  1731. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1732. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1733. xlSheet.Range("A8:B" & DF - 1).Select()
  1734. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1735. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1736. xlSheet.Range("C8:C" & DF - 1).Select() : myExcel.Selection.Style = "Percent"
  1737. xlSheet.Range("E8:E" & DF).Select() : myExcel.Selection.Style = "Percent"
  1738. xlSheet.Range("G8:G" & DF).Select() : myExcel.Selection.Style = "Percent"
  1739. xlSheet.Range("D8:D" & DF + 5).Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1740. xlSheet.Range("F8:F" & DF).Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1741. xlSheet.Range("H8:H" & DF).Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1742. xlSheet.Range("A" & DF & ":C" & DF).Select()
  1743. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1744. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1745. xlSheet.Range("B" & DF + 2 & ":B" & DF + 3).Select()
  1746. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1747. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1748. xlSheet.Range("D" & DF + 2 & ":E" & DF + 2).Select()
  1749. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1750. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1751. xlSheet.Range("D" & DF + 3 & ":E" & DF + 3).Select()
  1752. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1753. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1754. xlSheet.Range("D" & DF + 4 & ":E" & DF + 4).Select()
  1755. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1756. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1757. xlSheet.Range("D" & DF + 5 & ":F" & DF + 5).Select()
  1758. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1759. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1760. xlSheet.Range("B" & DF + 8 & ":D" & DF + 8).Select()
  1761. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1762. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1763. xlSheet.Range("B" & DF + 9 & ":D" & DF + 9).Select()
  1764. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1765. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1766. xlSheet.Range("A3:I4").Select()
  1767. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1768. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1769. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1770. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1771. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1772. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1773. xlSheet.Range("A5:I5").Select()
  1774. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1775. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1776. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1777. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1778. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1779. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1780. xlSheet.Range("A7:I7").Select()
  1781. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1782. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1783. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1784. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1785. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1786. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1787. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1788. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1789. xlSheet.Range("A8:I" & DF - 1).Select()
  1790. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1791. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1792. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1793. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1794. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1795. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1796. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1797. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1798. xlSheet.Range("A" & DF & ":I" & DF).Select()
  1799. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1800. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1801. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1802. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1803. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1804. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1805. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1806. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1807. xlSheet.Range("B" & DF + 3 & ":E" & DF + 3).Select()
  1808. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1809. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1810. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1811. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1812. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1813. xlSheet.Range("D" & DF + 5 & ":F" & DF + 5).Select()
  1814. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1815. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1816. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1817. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1818. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1819. xlSheet.Range("A" & DF + 1 & ":I" & DF + 10).Select()
  1820. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1821. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1822. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1823. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1824. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1825. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1826. xlSheet.Range("J" & DF + 3).Select() : myExcel.ActiveWindow.DisplayGridlines = False
  1827. xlSheet.Range("C7:D" & DF - 1).Select() : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent6 : .TintAndShade = 0 : End With
  1828. xlSheet.Range("D" & DF).Select() : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent6 : .TintAndShade = 0 : End With
  1829. xlSheet.Range("E7:F" & DF).Select() : With myExcel.Selection.Font : .Color = -16776961 : .TintAndShade = 0 : End With
  1830. xlSheet.Range("G7:H" & DF).Select() : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent1 : .TintAndShade = 0 : End With
  1831. xlSheet.Range("A7:I" & DF).Select() : myExcel.Selection.Font.Bold = True
  1832. xlSheet.Columns("J:J").Select : With myExcel.Selection.Font : .ThemeColor = xlThemeColorDark1 : .TintAndShade = 0 : End With
  1833. xlSheet.Columns("J:J").Select : myExcel.Selection.ColumnWidth = 0.5
  1834. xlSheet.Range("B" & DF + 2 & ":B" & DF + 5).Select()
  1835. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False
  1836. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1837. xlSheet.Range("B" & DF + 7 & ":D" & DF + 7).Select()
  1838. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False
  1839. .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
  1840. End With : myExcel.Selection.Merge
  1841. End Sub
  1842. Private Sub AB(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1843. Dim 位置 As String
  1844. xlSheet.Cells.Select()
  1845. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1846. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1847. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 5 : xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 30
  1848. xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 3 : xlSheet.Columns("D:E").Select : myExcel.Selection.ColumnWidth = 40
  1849. xlSheet.Rows("1:1").Select : myExcel.Selection.RowHeight = 95
  1850. xlSheet.Range("A2:E2").Select()
  1851. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1852. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1853. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 18 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1854. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1855. myExcel.Selection.Font.Underline = xlUnderlineStyleSingle
  1856. xlSheet.Range("A4:E4").Select()
  1857. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1858. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1859. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1860. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1861. xlSheet.Range("A6:B6").Select()
  1862. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1863. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1864. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1865. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1866. xlSheet.Range("C6:E6").Select()
  1867. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1868. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1869. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1870. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1871. xlSheet.Range("A7:B7").Select()
  1872. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1873. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1874. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1875. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1876. xlSheet.Rows("7:7").Select : myExcel.Selection.RowHeight = 30
  1877. xlSheet.Range("C7:E7").Select()
  1878. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1879. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1880. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1881. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1882. xlSheet.Range("A9:E9").Select()
  1883. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1884. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1885. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1886. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1887. xlSheet.Range("A6:B7").Select()
  1888. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1889. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : End With
  1890. xlSheet.Range("A11:B11").Select()
  1891. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1892. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1893. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1894. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1895. xlSheet.Range("A12:B12").Select()
  1896. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1897. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1898. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1899. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1900. xlSheet.Range("C11:E11").Select()
  1901. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1902. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1903. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1904. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1905. xlSheet.Rows("12:12").Select : myExcel.Selection.RowHeight = 30
  1906. xlSheet.Range("C12:E12").Select()
  1907. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1908. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1909. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1910. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1911. xlSheet.Range("A14:E14").Select()
  1912. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1913. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1914. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1915. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1916. If 請款期數_cb.Text = "四" Then : 位置 = "D16:D21" : Else : 位置 = "D16:D20" : End If : xlSheet.Range(位置).Select()
  1917. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1918. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1919. If 請款期數_cb.Text = "四" Then : 位置 = "C16:C21" : Else : 位置 = "C16:C20" : End If : xlSheet.Range(位置).Select()
  1920. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1921. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1922. If 請款期數_cb.Text = "四" Then
  1923. xlSheet.Rows("23:23").Select : myExcel.Selection.RowHeight = 30
  1924. xlSheet.Range("A23:E23").Select()
  1925. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1926. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1927. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1928. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1929. Else : End If
  1930. If 請款期數_cb.Text = "四" Then
  1931. xlSheet.Rows("24:24").Select : myExcel.Selection.RowHeight = 30 : 位置 = "A24:E24" : xlSheet.Range(位置).Select()
  1932. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1933. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1934. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1935. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1936. Else
  1937. xlSheet.Rows("22:22").Select : myExcel.Selection.RowHeight = 30 : 位置 = "A22:E22" : xlSheet.Range(位置).Select()
  1938. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1939. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1940. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1941. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1942. End If
  1943. If 請款期數_cb.Text = "四" Then : 位置 = "A25:E25" : Else : 位置 = "A23:E23" : End If : xlSheet.Range(位置).Select()
  1944. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1945. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1946. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1947. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1948. If 請款期數_cb.Text = "四" Then : xlSheet.Range("D27").Select() : Else : xlSheet.Range("D25").Select() : End If
  1949. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1950. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1951. If 請款期數_cb.Text = "四" Then : xlSheet.Range("E27").Select() : Else : xlSheet.Range("E25").Select() : End If
  1952. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1953. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1954. If 請款期數_cb.Text = "四" Then : xlSheet.Range("E29:E31").Select() : Else : xlSheet.Range("E27:E29").Select() : End If
  1955. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1956. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1957. If 請款期數_cb.Text = "四" Then : xlSheet.Range("B31:D31").Select() : Else : xlSheet.Range("B29:D29").Select() : End If
  1958. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1959. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1960. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1961. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1962. If 請款期數_cb.Text = "四" Then : xlSheet.Range("B30").Select() : Else : xlSheet.Range("B28").Select() : End If
  1963. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1964. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1965. If 請款期數_cb.Text = "四" Then : xlSheet.Rows("32:32").Select : Else : xlSheet.Rows("30:30").Select : End If : myExcel.Selection.RowHeight = 100
  1966. myExcel.ActiveWindow.DisplayGridlines = False
  1967. End Sub
  1968. Private Sub CC(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1969. Clipboard.SetDataObject(PictureBox1.Image)
  1970. xlSheet.Range("A1").Select()
  1971. myExcel.ActiveSheet.Pictures.Paste.Select
  1972. myExcel.Selection.ShapeRange.Height = 93
  1973. myExcel.Selection.ShapeRange.IncrementLeft(0)
  1974. myExcel.Selection.ShapeRange.IncrementTop(0)
  1975. End Sub
  1976. Private Sub DD(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1977. Clipboard.SetDataObject(PictureBox2.Image)
  1978. xlSheet.Range("A1").Select()
  1979. myExcel.ActiveSheet.Pictures.Paste.Select
  1980. myExcel.Selection.ShapeRange.Height = 93
  1981. myExcel.Selection.ShapeRange.IncrementLeft(0)
  1982. myExcel.Selection.ShapeRange.IncrementTop(0)
  1983. End Sub
  1984. Private Sub JCS(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1985. Clipboard.SetDataObject(JCS_PB.Image)
  1986. xlSheet.Range("A1").Select()
  1987. myExcel.ActiveSheet.Pictures.Paste.Select
  1988. myExcel.Selection.ShapeRange.Height = 93
  1989. myExcel.Selection.ShapeRange.IncrementLeft(0)
  1990. myExcel.Selection.ShapeRange.IncrementTop(0)
  1991. End Sub
  1992. Private Sub J2(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1993. Clipboard.SetDataObject(J2_PB.Image)
  1994. xlSheet.Range("A1").Select()
  1995. myExcel.ActiveSheet.Pictures.Paste.Select
  1996. myExcel.Selection.ShapeRange.Height = 93
  1997. myExcel.Selection.ShapeRange.IncrementLeft(0)
  1998. myExcel.Selection.ShapeRange.IncrementTop(0)
  1999. End Sub
  2000. Private Sub FF(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  2001. If Strings.Left(合約編號_tb.Text, 2) = "HX" Then
  2002. myExcel.ActiveSheet.PageSetup.CenterHeaderPicture.Filename =
  2003. Str01 & "\HXBWLOG.png"
  2004. Else
  2005. myExcel.ActiveSheet.PageSetup.CenterHeaderPicture.Filename =
  2006. Str01 & "\PGSBWLOG.png"
  2007. End If
  2008. myExcel.Application.PrintCommunication = False : With myExcel.ActiveSheet.PageSetup : .PrintTitleRows = "" : .PrintTitleColumns = "" : End With
  2009. myExcel.Application.PrintCommunication = True : myExcel.ActiveSheet.PageSetup.PrintArea = "" : myExcel.Application.PrintCommunication = False
  2010. With myExcel.ActiveSheet.PageSetup : .LeftHeader = ""
  2011. .CenterHeader = "" & Chr(10) & "" & Chr(10) & "" & Chr(10) & "" & Chr(10) & "" & Chr(10) & "" & Chr(10) & "" & Chr(10) & "" & Chr(10) & "&G"
  2012. .RightHeader = "" : .LeftFooter = "" : .CenterFooter = "第 &P 頁,共 &N 頁" : .RightFooter = ""
  2013. .LeftMargin = myExcel.Application.InchesToPoints(0.236220472440945) : .RightMargin = myExcel.Application.InchesToPoints(0.236220472440945)
  2014. .TopMargin = myExcel.Application.InchesToPoints(0.748031496062992) : .BottomMargin = myExcel.Application.InchesToPoints(0.748031496062992)
  2015. .HeaderMargin = myExcel.Application.InchesToPoints(0.31496062992126) : .FooterMargin = myExcel.Application.InchesToPoints(0.31496062992126)
  2016. .PrintHeadings = False : .PrintGridlines = False : .CenterHorizontally = True : .CenterVertically = False : .Draft = False
  2017. .FirstPageNumber = xlAutomatic : .BlackAndWhite = False : .Zoom = False : .FitToPagesWide = 1 : .FitToPagesTall = False : .OddAndEvenPagesHeaderFooter = False
  2018. .DifferentFirstPageHeaderFooter = False : .ScaleWithDocHeaderFooter = True : .AlignMarginsHeaderFooter = True
  2019. .EvenPage.LeftHeader.Text = "" : .EvenPage.CenterHeader.Text = "" : .EvenPage.RightHeader.Text = "" : .EvenPage.LeftFooter.Text = ""
  2020. .EvenPage.CenterFooter.Text = "" : .EvenPage.RightFooter.Text = "" : .FirstPage.LeftHeader.Text = "" : .FirstPage.CenterHeader.Text = ""
  2021. .FirstPage.RightHeader.Text = "" : .FirstPage.LeftFooter.Text = "" : .FirstPage.CenterFooter.Text = "" : .FirstPage.RightFooter.Text = ""
  2022. End With : myExcel.Application.PrintCommunication = True
  2023. End Sub
  2024. Private Sub 風格()
  2025. If 深色風格 = False Then
  2026. Me.BackColor = SystemColors.Control : Label11.BackColor = SystemColors.Control : Label2.BackColor = SystemColors.Control
  2027. Label5.BackColor = SystemColors.Control : Label40.BackColor = SystemColors.Control : TabPage5.BackColor = SystemColors.Control
  2028. TabPage6.BackColor = SystemColors.Control : TabPage7.BackColor = SystemColors.Control : TabPage8.BackColor = SystemColors.Control
  2029. TabPage9.BackColor = SystemColors.Control
  2030. Label7.ForeColor = Color.Black : Label11.ForeColor = Color.Black : Label24.ForeColor = Color.Black : Label18.ForeColor = Color.Black
  2031. Label23.ForeColor = Color.Black : Label17.ForeColor = Color.Black : Label13.ForeColor = Color.Black : Label16.ForeColor = Color.Black
  2032. Label20.ForeColor = Color.Black : Label14.ForeColor = Color.Black : Label12.ForeColor = Color.Black : Label15.ForeColor = Color.Black
  2033. Label2.ForeColor = Color.Black : Label5.ForeColor = Color.Black : Label19.ForeColor = Color.Black : Label40.ForeColor = Color.Black
  2034. Label45.ForeColor = Color.Black : Label46.ForeColor = Color.Black : Label41.ForeColor = Color.Black : Label38.ForeColor = Color.Black
  2035. Label43.ForeColor = Color.Black : Label44.ForeColor = Color.Black : Label414.ForeColor = Color.Black : Label42.ForeColor = Color.Black
  2036. Label39.ForeColor = Color.Black : 主頁_ch.ForeColor = Color.Black : 主頁明細_ch.ForeColor = Color.Black : 請款單_ch.ForeColor = Color.Black
  2037. 報告移交單_ch.ForeColor = Color.Black : 新版_ch.ForeColor = Color.Black : Label3.ForeColor = Color.Black : Label1.ForeColor = Color.Black
  2038. Label372.ForeColor = Color.FromArgb(192, 0, 0) : Label375.ForeColor = Color.FromArgb(192, 0, 0) : Label378.ForeColor = Color.FromArgb(192, 0, 0)
  2039. CH1.ForeColor = Color.Green : 稅額顯示_lb.ForeColor = Color.Green : CH2.ForeColor = Color.Green : Label390.ForeColor = Color.Green
  2040. Label389.ForeColor = Color.Green : Label388.ForeColor = Color.Green : Label387.ForeColor = Color.Green : Label386.ForeColor = Color.Green
  2041. Label21.ForeColor = Color.Green : Label8.ForeColor = Color.Green : Label6.ForeColor = Color.Green : Label9.ForeColor = Color.Green
  2042. Label37.ForeColor = Color.Blue : Label27.ForeColor = Color.Blue : Label26.ForeColor = Color.Blue : Label28.ForeColor = Color.Blue
  2043. Label29.ForeColor = Color.Blue : Label30.ForeColor = Color.Blue : Label36.ForeColor = Color.Blue : Label34.ForeColor = Color.Blue
  2044. Label33.ForeColor = Color.Blue : Label35.ForeColor = Color.Blue : Label31.ForeColor = Color.Blue : Label32.ForeColor = Color.Blue
  2045. Label4.ForeColor = Color.Black
  2046. 關鍵字搜尋_tb.BackColor = Color.White : 關鍵字搜尋_tb.ForeColor = Color.Black : 合約編號_tb.BackColor = Color.White : 合約編號_tb.ForeColor = Color.Black
  2047. 客戶名稱_tb.BackColor = Color.White : 客戶名稱_tb.ForeColor = Color.Black : 工程名稱_中_tb.BackColor = Color.White : 工程名稱_中_tb.ForeColor = Color.Black
  2048. 工程名稱_英_tb.BackColor = Color.White : 工程名稱_英_tb.ForeColor = Color.Black : 附錄編號_tb.BackColor = Color.White : 附錄編號_tb.ForeColor = Color.Black
  2049. 請款單號_tb.BackColor = Color.White : 請款單號_tb.ForeColor = Color.Black : 請款期數_cb.BackColor = Color.White : 請款期數_cb.ForeColor = Color.Black
  2050. 付款期限_cb.BackColor = Color.White : 付款期限_cb.ForeColor = Color.Black : 請款內容_tb.BackColor = Color.White : 請款內容_tb.ForeColor = Color.Black
  2051. 其他意見_tb.BackColor = Color.White : 其他意見_tb.ForeColor = Color.Black
  2052. NUD1.BackColor = Color.White : NUD1.ForeColor = Color.Black : NUD2.BackColor = Color.White : NUD2.ForeColor = Color.Black
  2053. NUD3.BackColor = Color.White : NUD3.ForeColor = Color.Black : 工程款1_nud.BackColor = Color.White : 工程款1_nud.ForeColor = Color.Black
  2054. 工程款3_nud.BackColor = Color.White : 工程款3_nud.ForeColor = Color.Black : 工程款4_nud.BackColor = Color.White : 工程款4_nud.ForeColor = Color.Black
  2055. 工程款5_nud.BackColor = Color.White : 工程款5_nud.ForeColor = Color.Black : 工程款6_nud.BackColor = Color.White : 工程款6_nud.ForeColor = Color.Black
  2056. 工程款2_nud.BackColor = Color.White : 工程款2_nud.ForeColor = Color.Black : 金額1_und.BackColor = Color.White : 金額1_und.ForeColor = Color.Black
  2057. 金額2_und.BackColor = Color.White : 金額2_und.ForeColor = Color.Black : 金額3_und.BackColor = Color.White : 金額3_und.ForeColor = Color.Black
  2058. 金額4_und.BackColor = Color.White : 金額4_und.ForeColor = Color.Black : 金額5_und.BackColor = Color.White : 金額5_und.ForeColor = Color.Black
  2059. 金額6_und.BackColor = Color.White : 金額6_und.ForeColor = Color.Black : NUD4.BackColor = Color.White : NUD4.ForeColor = Color.Black
  2060. NUD5.BackColor = Color.White : NUD5.ForeColor = Color.Black : NUD6.BackColor = Color.White : NUD6.ForeColor = Color.Black
  2061. ANUD1.BackColor = Color.White : ANUD1.ForeColor = Color.Black : ANUD2.BackColor = Color.White : ANUD2.ForeColor = Color.Black
  2062. ANUD3.BackColor = Color.White : ANUD3.ForeColor = Color.Black : ANUD4.BackColor = Color.White : ANUD4.ForeColor = Color.Black
  2063. ANUD5.BackColor = Color.White : ANUD5.ForeColor = Color.Black : BNUD1.BackColor = Color.White : BNUD1.ForeColor = Color.Black
  2064. BNUD2.BackColor = Color.White : BNUD2.ForeColor = Color.Black : BNUD3.BackColor = Color.White : BNUD3.ForeColor = Color.Black
  2065. BNUD4.BackColor = Color.White : BNUD4.ForeColor = Color.Black : BNUD5.BackColor = Color.White : BNUD5.ForeColor = Color.Black
  2066. 請款金額_nud.BackColor = Color.White : 請款金額_nud.ForeColor = Color.Black : 請款總額_nud.BackColor = Color.White : 請款總額_nud.ForeColor = Color.Black
  2067. 合約編號1_cb.BackColor = Color.White : 合約編號1_cb.ForeColor = Color.Blue : Label47.ForeColor = Color.Blue
  2068. 語轉扭_bt.BackColor = Color.White : 語轉扭_bt.ForeColor = Color.Black : 查詢_bt.BackColor = Color.White : 查詢_bt.ForeColor = Color.Black
  2069. 縮放2_bt.BackColor = Color.White : 縮放2_bt.ForeColor = Color.Black : 開新的請款單_bt.BackColor = Color.White : 開新的請款單_bt.ForeColor = Color.Black
  2070. 存檔_bt.BackColor = Color.White : 存檔_bt.ForeColor = Color.Black : 報告移交_bt.BackColor = Color.White : 報告移交_bt.ForeColor = Color.Black
  2071. 列印_bt.BackColor = Color.White : 列印_bt.ForeColor = Color.Black : 刪除_bt.BackColor = Color.White : 刪除_bt.ForeColor = Color.Black
  2072. 存檔_tb.BackColor = Color.White : 存檔_tb.ForeColor = Color.Green
  2073. 合約_dgv.EnableHeadersVisualStyles = True : 合約_dgv.BackgroundColor = Color.White : 合約_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black
  2074. 合約_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.LightPink
  2075. 合約_dgv.DefaultCellStyle.BackColor = Color.White : 合約_dgv.DefaultCellStyle.ForeColor = Color.Black
  2076. 合約附錄_dgv.EnableHeadersVisualStyles = True : 合約附錄_dgv.BackgroundColor = Color.White : 合約附錄_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black
  2077. 合約附錄_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.LightPink
  2078. 合約附錄_dgv.DefaultCellStyle.BackColor = Color.White : 合約附錄_dgv.DefaultCellStyle.ForeColor = Color.Black
  2079. 請款單_dgv.EnableHeadersVisualStyles = True : 請款單_dgv.BackgroundColor = Color.White : 請款單_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black
  2080. 請款單_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.LightPink
  2081. 請款單_dgv.DefaultCellStyle.BackColor = Color.White : 請款單_dgv.DefaultCellStyle.ForeColor = Color.Black
  2082. 第1期_dgv.EnableHeadersVisualStyles = True : 第1期_dgv.BackgroundColor = Color.White : 第1期_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black
  2083. 第1期_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.LightPink
  2084. 第1期_dgv.DefaultCellStyle.BackColor = Color.White : 第1期_dgv.DefaultCellStyle.ForeColor = Color.Black
  2085. 第2期_dgv.EnableHeadersVisualStyles = True : 第2期_dgv.BackgroundColor = Color.White : 第2期_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black
  2086. 第2期_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.LightPink
  2087. 第2期_dgv.DefaultCellStyle.BackColor = Color.White : 第2期_dgv.DefaultCellStyle.ForeColor = Color.Black
  2088. 第3期_dgv.EnableHeadersVisualStyles = True : 第3期_dgv.BackgroundColor = Color.White : 第3期_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black
  2089. 第3期_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.LightPink
  2090. 第3期_dgv.DefaultCellStyle.BackColor = Color.White : 第3期_dgv.DefaultCellStyle.ForeColor = Color.Black
  2091. 第4期_dgv.EnableHeadersVisualStyles = True : 第4期_dgv.BackgroundColor = Color.White : 第4期_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black
  2092. 第4期_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.LightPink
  2093. 第4期_dgv.DefaultCellStyle.BackColor = Color.White : 第4期_dgv.DefaultCellStyle.ForeColor = Color.Black
  2094. 第5期_dgv.EnableHeadersVisualStyles = True : 第5期_dgv.BackgroundColor = Color.White : 第5期_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black
  2095. 第5期_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.LightPink
  2096. 第5期_dgv.DefaultCellStyle.BackColor = Color.White : 第5期_dgv.DefaultCellStyle.ForeColor = Color.Black
  2097. Else
  2098. Me.BackColor = Color.Black : Label11.BackColor = Color.Black : Label2.BackColor = Color.Black : Label5.BackColor = Color.Black
  2099. Label40.BackColor = Color.Black : TabPage5.BackColor = Color.Black : TabPage6.BackColor = Color.Black : TabPage7.BackColor = Color.Black
  2100. TabPage8.BackColor = Color.Black : TabPage9.BackColor = Color.Black
  2101. Label7.ForeColor = Color.White : Label11.ForeColor = Color.White : Label24.ForeColor = Color.White : Label18.ForeColor = Color.White
  2102. Label23.ForeColor = Color.White : Label17.ForeColor = Color.White : Label13.ForeColor = Color.White : Label16.ForeColor = Color.White
  2103. Label20.ForeColor = Color.White : Label14.ForeColor = Color.White : Label12.ForeColor = Color.White : Label15.ForeColor = Color.White
  2104. Label2.ForeColor = Color.White : Label5.ForeColor = Color.White : Label19.ForeColor = Color.White : Label40.ForeColor = Color.White
  2105. Label45.ForeColor = Color.White : Label46.ForeColor = Color.White : Label41.ForeColor = Color.White : Label38.ForeColor = Color.White
  2106. Label43.ForeColor = Color.White : Label44.ForeColor = Color.White : Label414.ForeColor = Color.White : Label42.ForeColor = Color.White
  2107. Label39.ForeColor = Color.White : 主頁_ch.ForeColor = Color.White : 主頁明細_ch.ForeColor = Color.White : 請款單_ch.ForeColor = Color.White
  2108. 報告移交單_ch.ForeColor = Color.White : 新版_ch.ForeColor = Color.White : Label3.ForeColor = Color.White : Label1.ForeColor = Color.White
  2109. Label372.ForeColor = Color.LightPink : Label375.ForeColor = Color.LightPink : Label378.ForeColor = Color.LightPink
  2110. CH1.ForeColor = Color.LightGreen : 稅額顯示_lb.ForeColor = Color.LightGreen : CH2.ForeColor = Color.LightGreen : Label390.ForeColor = Color.LightGreen
  2111. Label389.ForeColor = Color.LightGreen : Label388.ForeColor = Color.LightGreen : Label387.ForeColor = Color.LightGreen : Label386.ForeColor = Color.LightGreen
  2112. Label21.ForeColor = Color.LightGreen : Label8.ForeColor = Color.LightGreen : Label6.ForeColor = Color.LightGreen : Label9.ForeColor = Color.LightGreen
  2113. Label37.ForeColor = Color.LightBlue : Label27.ForeColor = Color.LightBlue : Label26.ForeColor = Color.LightBlue : Label28.ForeColor = Color.LightBlue
  2114. Label29.ForeColor = Color.LightBlue : Label30.ForeColor = Color.LightBlue : Label36.ForeColor = Color.LightBlue : Label34.ForeColor = Color.LightBlue
  2115. Label33.ForeColor = Color.LightBlue : Label35.ForeColor = Color.LightBlue : Label31.ForeColor = Color.LightBlue : Label32.ForeColor = Color.LightBlue
  2116. Label4.ForeColor = Color.White
  2117. 關鍵字搜尋_tb.BackColor = Color.DimGray : 關鍵字搜尋_tb.ForeColor = Color.White : 合約編號_tb.BackColor = Color.DimGray : 合約編號_tb.ForeColor = Color.White
  2118. 客戶名稱_tb.BackColor = Color.DimGray : 客戶名稱_tb.ForeColor = Color.White : 工程名稱_中_tb.BackColor = Color.DimGray : 工程名稱_中_tb.ForeColor = Color.White
  2119. 工程名稱_英_tb.BackColor = Color.DimGray : 工程名稱_英_tb.ForeColor = Color.White : 附錄編號_tb.BackColor = Color.DimGray : 附錄編號_tb.ForeColor = Color.White
  2120. 請款單號_tb.BackColor = Color.DimGray : 請款單號_tb.ForeColor = Color.White : 請款期數_cb.BackColor = Color.DimGray : 請款期數_cb.ForeColor = Color.White
  2121. 付款期限_cb.BackColor = Color.DimGray : 付款期限_cb.ForeColor = Color.White : 請款內容_tb.BackColor = Color.DimGray : 請款內容_tb.ForeColor = Color.White
  2122. 其他意見_tb.BackColor = Color.DimGray : 其他意見_tb.ForeColor = Color.White
  2123. NUD1.BackColor = Color.DimGray : NUD1.ForeColor = Color.White : NUD2.BackColor = Color.DimGray : NUD2.ForeColor = Color.White
  2124. NUD3.BackColor = Color.DimGray : NUD3.ForeColor = Color.White : 工程款1_nud.BackColor = Color.DimGray : 工程款1_nud.ForeColor = Color.White
  2125. 工程款3_nud.BackColor = Color.DimGray : 工程款3_nud.ForeColor = Color.White : 工程款4_nud.BackColor = Color.DimGray : 工程款4_nud.ForeColor = Color.White
  2126. 工程款5_nud.BackColor = Color.DimGray : 工程款5_nud.ForeColor = Color.White : 工程款6_nud.BackColor = Color.DimGray : 工程款6_nud.ForeColor = Color.White
  2127. 工程款2_nud.BackColor = Color.DimGray : 工程款2_nud.ForeColor = Color.White : 金額1_und.BackColor = Color.DimGray : 金額1_und.ForeColor = Color.White
  2128. 金額2_und.BackColor = Color.DimGray : 金額2_und.ForeColor = Color.White : 金額3_und.BackColor = Color.DimGray : 金額3_und.ForeColor = Color.White
  2129. 金額4_und.BackColor = Color.DimGray : 金額4_und.ForeColor = Color.White : 金額5_und.BackColor = Color.DimGray : 金額5_und.ForeColor = Color.White
  2130. 金額6_und.BackColor = Color.DimGray : 金額6_und.ForeColor = Color.White : NUD4.BackColor = Color.DimGray : NUD4.ForeColor = Color.White
  2131. NUD5.BackColor = Color.DimGray : NUD5.ForeColor = Color.White : NUD6.BackColor = Color.DimGray : NUD6.ForeColor = Color.White
  2132. ANUD1.BackColor = Color.DimGray : ANUD1.ForeColor = Color.White : ANUD2.BackColor = Color.DimGray : ANUD2.ForeColor = Color.White
  2133. ANUD3.BackColor = Color.DimGray : ANUD3.ForeColor = Color.White : ANUD4.BackColor = Color.DimGray : ANUD4.ForeColor = Color.White
  2134. ANUD5.BackColor = Color.DimGray : ANUD5.ForeColor = Color.White : BNUD1.BackColor = Color.DimGray : BNUD1.ForeColor = Color.White
  2135. BNUD2.BackColor = Color.DimGray : BNUD2.ForeColor = Color.White : BNUD3.BackColor = Color.DimGray : BNUD3.ForeColor = Color.White
  2136. BNUD4.BackColor = Color.DimGray : BNUD4.ForeColor = Color.White : BNUD5.BackColor = Color.DimGray : BNUD5.ForeColor = Color.White
  2137. 請款金額_nud.BackColor = Color.DimGray : 請款金額_nud.ForeColor = Color.White : 請款總額_nud.BackColor = Color.DimGray : 請款總額_nud.ForeColor = Color.White
  2138. 合約編號1_cb.BackColor = Color.DimGray : 合約編號1_cb.ForeColor = Color.LightBlue : Label47.ForeColor = Color.LightBlue
  2139. 語轉扭_bt.BackColor = Color.DimGray : 語轉扭_bt.ForeColor = Color.White : 查詢_bt.BackColor = Color.DimGray : 查詢_bt.ForeColor = Color.White
  2140. 縮放2_bt.BackColor = Color.DimGray : 縮放2_bt.ForeColor = Color.White : 開新的請款單_bt.BackColor = Color.DimGray : 開新的請款單_bt.ForeColor = Color.White
  2141. 存檔_bt.BackColor = Color.DimGray : 存檔_bt.ForeColor = Color.White : 報告移交_bt.BackColor = Color.DimGray : 報告移交_bt.ForeColor = Color.White
  2142. 列印_bt.BackColor = Color.DimGray : 列印_bt.ForeColor = Color.White : 刪除_bt.BackColor = Color.DimGray : 刪除_bt.ForeColor = Color.White
  2143. 存檔_tb.BackColor = Color.DimGray : 存檔_tb.ForeColor = Color.LightGreen
  2144. 合約_dgv.EnableHeadersVisualStyles = False : 合約_dgv.BackgroundColor = Color.DimGray : 合約_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White
  2145. 合約_dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.Black : 合約_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.DimGray
  2146. 合約_dgv.DefaultCellStyle.BackColor = Color.Black : 合約_dgv.DefaultCellStyle.ForeColor = Color.White
  2147. 合約附錄_dgv.EnableHeadersVisualStyles = False : 合約附錄_dgv.BackgroundColor = Color.DimGray : 合約附錄_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White
  2148. 合約附錄_dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.Black : 合約附錄_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.DimGray
  2149. 合約附錄_dgv.DefaultCellStyle.BackColor = Color.Black : 合約附錄_dgv.DefaultCellStyle.ForeColor = Color.White
  2150. 請款單_dgv.EnableHeadersVisualStyles = False : 請款單_dgv.BackgroundColor = Color.DimGray : 請款單_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White
  2151. 請款單_dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.Black : 請款單_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.DimGray
  2152. 請款單_dgv.DefaultCellStyle.BackColor = Color.Black : 請款單_dgv.DefaultCellStyle.ForeColor = Color.White
  2153. 第1期_dgv.EnableHeadersVisualStyles = False : 第1期_dgv.BackgroundColor = Color.DimGray : 第1期_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White
  2154. 第1期_dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.Black : 第1期_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.DimGray
  2155. 第1期_dgv.DefaultCellStyle.BackColor = Color.Black : 第1期_dgv.DefaultCellStyle.ForeColor = Color.White
  2156. 第2期_dgv.EnableHeadersVisualStyles = False : 第2期_dgv.BackgroundColor = Color.DimGray : 第2期_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White
  2157. 第2期_dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.Black : 第2期_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.DimGray
  2158. 第2期_dgv.DefaultCellStyle.BackColor = Color.Black : 第2期_dgv.DefaultCellStyle.ForeColor = Color.White
  2159. 第3期_dgv.EnableHeadersVisualStyles = False : 第3期_dgv.BackgroundColor = Color.DimGray : 第3期_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White
  2160. 第3期_dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.Black : 第3期_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.DimGray
  2161. 第3期_dgv.DefaultCellStyle.BackColor = Color.Black : 第3期_dgv.DefaultCellStyle.ForeColor = Color.White
  2162. 第4期_dgv.EnableHeadersVisualStyles = False : 第4期_dgv.BackgroundColor = Color.DimGray : 第4期_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White
  2163. 第4期_dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.Black : 第4期_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.DimGray
  2164. 第4期_dgv.DefaultCellStyle.BackColor = Color.Black : 第4期_dgv.DefaultCellStyle.ForeColor = Color.White
  2165. 第5期_dgv.EnableHeadersVisualStyles = False : 第5期_dgv.BackgroundColor = Color.DimGray : 第5期_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White
  2166. 第5期_dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.Black : 第5期_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.DimGray
  2167. 第5期_dgv.DefaultCellStyle.BackColor = Color.Black : 第5期_dgv.DefaultCellStyle.ForeColor = Color.White
  2168. End If
  2169. End Sub
  2170. End Class