説明なし
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

合約請款單.vb 159KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576
  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. Public Class 合約請款單
  11. ReadOnly ds1, ds2, ds6, ds7, ds8, ds9, ds10, ds11, ds15 As New DataSet
  12. Dim ESTR As String
  13. Dim EDR As Integer = 0
  14. Dim xlApp As Application : Dim xlBook As Workbook : Dim xlSheet As Worksheet
  15. Dim OldX, OldY As Long
  16. Dim drag, 放大 As Boolean
  17. Private Sub Set_合約清單()
  18. 合約_dgv.DataSource = Nothing : ds6.Clear()
  19. 合約_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  20. 合約_dgv.ColumnHeadersHeight = 25 : 合約_dgv.AllowUserToAddRows = False
  21. PA46 = 合約編號1_cb.Text : PA47 = 工程期1_ch.Text
  22. SQL_合約清單_請款用()
  23. da.Fill(ds6) : 合約_dgv.DataSource = ds6.Tables(0) : conn.Close()
  24. 合約_dgv.Columns(0).FillWeight = 160 : 合約_dgv.Columns(1).Visible = False : 合約_dgv.Columns(2).Visible = False : 合約_dgv.Columns(3).Visible = False
  25. 合約_dgv.Columns(4).Visible = False : 合約_dgv.Columns(5).Visible = False : 合約_dgv.Columns(6).Visible = False : 合約_dgv.Columns(7).Visible = False
  26. 合約_dgv.Columns(8).Visible = False : 合約_dgv.Columns(9).Visible = False : 合約_dgv.Columns(10).Visible = False : 合約_dgv.Columns(11).Visible = False
  27. 合約_dgv.Columns(12).Visible = False : 合約_dgv.Columns(13).Visible = False : 合約_dgv.Columns(14).Visible = False : 合約_dgv.Columns(15).Visible = False
  28. 合約_dgv.Columns(16).Visible = False : 合約_dgv.Columns(17).Visible = False : 合約_dgv.Columns(18).Visible = False : 合約_dgv.Columns(19).Visible = False
  29. 合約_dgv.Columns(20).Visible = False : 合約_dgv.Columns(21).Visible = False : 合約_dgv.Columns(22).Visible = False : 合約_dgv.Columns(23).Visible = False
  30. 合約_dgv.Columns(24).FillWeight = 100 : 合約_dgv.Columns(25).Visible = False : 合約_dgv.Columns(26).Visible = False : 合約_dgv.Columns(27).Visible = False
  31. 合約_dgv.Columns(28).Visible = False : 合約_dgv.Columns(29).Visible = False : 合約_dgv.Columns(30).Visible = False : 合約_dgv.Columns("工程名稱_中").FillWeight = 300
  32. If 放大 = True Then
  33. 合約_dgv.Columns("工程名稱_中").Visible = True
  34. Else
  35. 合約_dgv.Columns("工程名稱_中").Visible = False
  36. End If
  37. End Sub
  38. Private Sub Set_附錄清單()
  39. 合約附錄_dgv.DataSource = Nothing : ds1.Clear()
  40. 合約附錄_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  41. 合約附錄_dgv.ColumnHeadersHeight = 25 : 合約附錄_dgv.AllowUserToAddRows = False
  42. SQL_附錄合約_清單查詢1()
  43. da.Fill(ds1) : 合約附錄_dgv.DataSource = ds1.Tables(0) : conn.Close()
  44. 合約附錄_dgv.Columns(0).Visible = False : 合約附錄_dgv.Columns(1).FillWeight = 160 : 合約附錄_dgv.Columns(2).Visible = False : 合約附錄_dgv.Columns(3).Visible = False
  45. 合約附錄_dgv.Columns(4).Visible = False : 合約附錄_dgv.Columns(5).Visible = False : 合約附錄_dgv.Columns(6).Visible = False : 合約附錄_dgv.Columns(7).FillWeight = 70
  46. End Sub
  47. Private Sub Set_合約報價總表()
  48. 報價總表_dgv.DataSource = Nothing : ds15.Clear()
  49. 報價總表_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  50. 報價總表_dgv.ColumnHeadersHeight = 40 : 報價總表_dgv.AllowUserToAddRows = False : 報價總表_dgv.RowTemplate.Height = 45
  51. 報價總表_dgv.RowsDefaultCellStyle.WrapMode = DataGridViewTriState.True
  52. SQL_合約報價總表()
  53. da.Fill(ds15) : 報價總表_dgv.DataSource = ds15.Tables(0) : conn.Close()
  54. 報價總表_dgv.Columns(0).Visible = False : 報價總表_dgv.Columns(8).Visible = False : 報價總表_dgv.Columns(9).Visible = False
  55. 報價總表_dgv.Columns(0).FillWeight = 50 : 報價總表_dgv.Columns(1).FillWeight = 50 : 報價總表_dgv.Columns(2).FillWeight = 210
  56. 報價總表_dgv.Columns(3).FillWeight = 50 : 報價總表_dgv.Columns(4).FillWeight = 50 : 報價總表_dgv.Columns(5).FillWeight = 80
  57. 報價總表_dgv.Columns(6).FillWeight = 80 : 報價總表_dgv.Columns(7).FillWeight = 90
  58. For i As Integer = 4 To 6 : 報價總表_dgv.Columns(i).DefaultCellStyle.Format = "#,##0" : Next
  59. For i As Integer = 4 To 6 : 報價總表_dgv.Columns(i).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : Next
  60. For i As Integer = 0 To 7 : 報價總表_dgv.Columns(i).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter : Next
  61. 報價總表_dgv.Columns(1).ReadOnly = True : 報價總表_dgv.Columns(2).ReadOnly = True : 報價總表_dgv.Columns(6).ReadOnly = True
  62. 報價總表_dgv.EditMode = DataGridViewEditMode.EditOnEnter
  63. End Sub
  64. Private Sub Set_請款清單()
  65. 請款單_dgv.DataSource = Nothing : ds2.Clear()
  66. 請款單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  67. 請款單_dgv.ColumnHeadersHeight = 25 : 請款單_dgv.AllowUserToAddRows = False
  68. SQL_請款單_清單查詢()
  69. da.Fill(ds2) : 請款單_dgv.DataSource = ds2.Tables(0) : conn.Close()
  70. 請款單_dgv.Columns(0).Visible = False : 請款單_dgv.Columns(1).FillWeight = 50 : 請款單_dgv.Columns(2).Visible = False : 請款單_dgv.Columns(3).FillWeight = 50
  71. 請款單_dgv.Columns(4).FillWeight = 100 : 請款單_dgv.Columns(5).FillWeight = 50 : 請款單_dgv.Columns(6).Visible = False : 請款單_dgv.Columns(7).Visible = False
  72. 請款單_dgv.Columns(8).FillWeight = 100 : 請款單_dgv.Columns(9).FillWeight = 80
  73. 請款單_dgv.Columns(3).DefaultCellStyle.Format = "#,##0" : 請款單_dgv.Columns(4).DefaultCellStyle.Format = "#,##0"
  74. 請款單_dgv.Columns(5).DefaultCellStyle.Format = "#,##0" : 請款單_dgv.Columns(8).DefaultCellStyle.Format = "#,##0"
  75. 請款單_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  76. 請款單_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  77. 請款單_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  78. 請款單_dgv.Columns(8).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  79. End Sub
  80. Private Sub Set_合約明細1()
  81. 第1期_dgv.DataSource = Nothing : ds7.Clear()
  82. 第1期_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  83. 第1期_dgv.ColumnHeadersHeight = 25 : 第1期_dgv.AllowUserToAddRows = False
  84. SQL_合約明細讀取()
  85. da.Fill(ds7) : 第1期_dgv.DataSource = ds7.Tables(0) : conn.Close()
  86. 第1期_dgv.Columns(0).Visible = False : 第1期_dgv.Columns(1).Visible = False : 第1期_dgv.Columns(2).FillWeight = 20 : 第1期_dgv.Columns(3).FillWeight = 140
  87. 第1期_dgv.Columns(4).FillWeight = 20 : 第1期_dgv.Columns(5).FillWeight = 50
  88. 第1期_dgv.Columns(2).ReadOnly = True : 第1期_dgv.Columns(5).ReadOnly = True
  89. 第1期_dgv.EditMode = DataGridViewEditMode.EditOnEnter
  90. 第1期_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : 第1期_dgv.Columns(4).DefaultCellStyle.Format = "#,##0.00" : 第1期_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
  91. 第1期_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 第1期_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  92. End Sub
  93. Private Sub Set_合約明細2()
  94. 第2期_dgv.DataSource = Nothing : ds8.Clear()
  95. 第2期_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  96. 第2期_dgv.ColumnHeadersHeight = 25 : 第2期_dgv.AllowUserToAddRows = False
  97. SQL_合約明細讀取()
  98. da.Fill(ds8) : 第2期_dgv.DataSource = ds8.Tables(0) : conn.Close()
  99. 第2期_dgv.Columns(0).Visible = False : 第2期_dgv.Columns(1).Visible = False : 第2期_dgv.Columns(2).FillWeight = 20 : 第2期_dgv.Columns(3).FillWeight = 140
  100. 第2期_dgv.Columns(4).FillWeight = 20 : 第2期_dgv.Columns(5).FillWeight = 50
  101. 第2期_dgv.Columns(2).ReadOnly = True : 第2期_dgv.Columns(5).ReadOnly = True
  102. 第2期_dgv.EditMode = DataGridViewEditMode.EditOnEnter
  103. 第2期_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : 第2期_dgv.Columns(4).DefaultCellStyle.Format = "#,##0.00" : 第2期_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
  104. 第2期_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 第2期_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  105. End Sub
  106. Private Sub Set_合約明細3()
  107. 第3期_dgv.DataSource = Nothing : ds9.Clear()
  108. 第3期_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  109. 第3期_dgv.ColumnHeadersHeight = 25
  110. 第3期_dgv.AllowUserToAddRows = False
  111. SQL_合約明細讀取()
  112. da.Fill(ds9) : 第3期_dgv.DataSource = ds9.Tables(0) : conn.Close()
  113. 第3期_dgv.Columns(0).Visible = False : 第3期_dgv.Columns(1).Visible = False : 第3期_dgv.Columns(2).FillWeight = 20 : 第3期_dgv.Columns(3).FillWeight = 140
  114. 第3期_dgv.Columns(4).FillWeight = 20 : 第3期_dgv.Columns(5).FillWeight = 50
  115. 第3期_dgv.Columns(2).ReadOnly = True : 第3期_dgv.Columns(5).ReadOnly = True
  116. 第3期_dgv.EditMode = DataGridViewEditMode.EditOnEnter
  117. 第3期_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : 第3期_dgv.Columns(4).DefaultCellStyle.Format = "#,##0.00" : 第3期_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
  118. 第3期_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 第3期_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  119. End Sub
  120. Private Sub Set_合約明細4()
  121. 第4期_dgv.DataSource = Nothing : ds10.Clear()
  122. 第4期_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  123. 第4期_dgv.ColumnHeadersHeight = 25 : 第4期_dgv.AllowUserToAddRows = False
  124. SQL_合約明細讀取()
  125. da.Fill(ds10) : 第4期_dgv.DataSource = ds10.Tables(0) : conn.Close()
  126. 第4期_dgv.Columns(0).Visible = False : 第4期_dgv.Columns(1).Visible = False : 第4期_dgv.Columns(2).FillWeight = 20 : 第4期_dgv.Columns(3).FillWeight = 140
  127. 第4期_dgv.Columns(4).FillWeight = 20 : 第4期_dgv.Columns(5).FillWeight = 50
  128. 第4期_dgv.Columns(2).ReadOnly = True : 第4期_dgv.Columns(5).ReadOnly = True
  129. 第4期_dgv.EditMode = DataGridViewEditMode.EditOnEnter
  130. 第4期_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : 第4期_dgv.Columns(4).DefaultCellStyle.Format = "#,##0.00" : 第4期_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
  131. 第4期_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 第4期_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  132. End Sub
  133. Private Sub Set_合約明細5()
  134. 第5期_dgv.DataSource = Nothing : ds11.Clear()
  135. 第5期_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  136. 第5期_dgv.ColumnHeadersHeight = 25 : 第5期_dgv.AllowUserToAddRows = False
  137. SQL_合約明細讀取()
  138. da.Fill(ds11) : 第5期_dgv.DataSource = ds11.Tables(0) : conn.Close()
  139. 第5期_dgv.Columns(0).Visible = False : 第5期_dgv.Columns(1).Visible = False : 第5期_dgv.Columns(2).FillWeight = 20 : 第5期_dgv.Columns(3).FillWeight = 140
  140. 第5期_dgv.Columns(4).FillWeight = 20 : 第5期_dgv.Columns(5).FillWeight = 50
  141. 第5期_dgv.Columns(2).ReadOnly = True : 第5期_dgv.Columns(5).ReadOnly = True
  142. 第5期_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : 第5期_dgv.Columns(4).DefaultCellStyle.Format = "#,##0.00" : 第5期_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
  143. 第5期_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 第5期_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  144. End Sub
  145. Private Sub 甲方條件下拉清單讀取()
  146. SQL合約條件讀取() : 合約編號1_cb.Items.Clear() : 合約編號1_cb.Items.Add("") : While (dr.Read()) : 合約編號1_cb.Items.Add(dr("約號甲方")) : End While : conn.Close()
  147. End Sub
  148. Private Sub 合約請款單_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  149. Me.MdiParent = HX_PGS_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
  150. 工程款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
  151. 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
  152. SOP3_P.SizeMode = 4 : SOP4_P.SizeMode = 4 : SOP5_P.SizeMode = 4 : SOP6_P.SizeMode = 4 : SOP7_P.SizeMode = 4
  153. 甲方條件下拉清單讀取() : Set_合約清單() : 合約報價單_Siz()
  154. End Sub
  155. Private Sub 合約請款單_Closed(sender As Object, e As EventArgs) Handles MyBase.Closed
  156. MyModule1.虛擬桌面開啟()
  157. End Sub
  158. Private Sub 合約報價單_Siz()
  159. MyModule1.清單字體大小調整()
  160. 合約_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", 7.6)
  161. 合約附錄_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  162. 請款單_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  163. 第1期_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  164. 第2期_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  165. 第3期_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  166. 第4期_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  167. 第5期_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  168. End Sub
  169. Private Sub 登入閒置控制_MouseMove(sender As Object, e As EventArgs) Handles MyBase.MouseMove
  170. timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
  171. End Sub
  172. Private Sub 登入閒置控制_KeyPress(sender As Object, e As EventArgs) Handles MyBase.KeyPress
  173. timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
  174. End Sub
  175. Private Sub 請款計算()
  176. 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
  177. ANUD4.Value = 0 : For i As Integer = 0 To 請款單_dgv.Rows.Count - 1 : ANUD4.Value += 請款單_dgv("請款總額", i).Value.ToString : Next
  178. ANUD1.Value = NUD3.Value : ANUD3.Value = NUD5.Value : ANUD2.Value = ANUD1.Value + ANUD3.Value : ANUD5.Value = ANUD2.Value - ANUD4.Value
  179. '----收款累加---------------
  180. Dim 已收款 As Long = 0
  181. For DD As Integer = 0 To 1
  182. For i As Integer = 0 To 請款單_dgv.Rows.Count - 1 : 已收款 += 請款單_dgv("請款總額", i).Value : Next
  183. If 已收款 = 0 Then : Else
  184. If 已收款 = BNUD1.Value Then : BNUD1.Value = 0 : Exit For : ElseIf 已收款 < BNUD1.Value Then : BNUD1.Value = BNUD1.Value - 已收款 : Exit For
  185. ElseIf 已收款 > BNUD1.Value Then : 已收款 -= BNUD1.Value : BNUD1.Value = 0 : End If
  186. If 已收款 = BNUD2.Value Then : BNUD2.Value = 0 : Exit For : ElseIf 已收款 < BNUD2.Value Then : BNUD2.Value = BNUD2.Value - 已收款 : Exit For
  187. ElseIf 已收款 > BNUD2.Value Then : 已收款 -= BNUD2.Value : BNUD2.Value = 0 : End If
  188. If 已收款 = BNUD3.Value Then : BNUD3.Value = 0 : Exit For : ElseIf 已收款 < BNUD3.Value Then : BNUD3.Value = BNUD3.Value - 已收款 : Exit For
  189. ElseIf 已收款 > BNUD3.Value Then : 已收款 -= BNUD3.Value : BNUD3.Value = 0 : End If
  190. If 已收款 = BNUD4.Value Then : BNUD4.Value = 0 : Exit For : ElseIf 已收款 < BNUD4.Value Then : BNUD4.Value = BNUD4.Value - 已收款 : Exit For
  191. ElseIf 已收款 > BNUD4.Value Then : 已收款 -= BNUD4.Value : BNUD4.Value = 0 : End If
  192. If 已收款 = BNUD5.Value Then : BNUD5.Value = 0 : Exit For : ElseIf 已收款 < BNUD5.Value Then : BNUD5.Value = BNUD5.Value - 已收款 : Exit For
  193. ElseIf 已收款 > BNUD5.Value Then : BNUD5.Value = 0 : End If
  194. End If
  195. Next
  196. 'My.Resources._1_123 綠色 My.Resources._1_124 紅色 My.Resources._1_125 橘色
  197. 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
  198. ElseIf 工程款1_nud.Value = 0 And BNUD1.Value = 0 Then : SOP3_P.Image = My.Resources._1_124 : End If : SOP3_P.SizeMode = 4
  199. 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
  200. ElseIf 工程款2_nud.Value = 0 And BNUD2.Value = 0 Then : SOP4_P.Image = My.Resources._1_124 : End If : SOP4_P.SizeMode = 4
  201. 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
  202. ElseIf 工程款3_nud.Value = 0 And BNUD3.Value = 0 Then : SOP5_P.Image = My.Resources._1_124 : End If : SOP5_P.SizeMode = 4
  203. 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
  204. ElseIf 工程款4_nud.Value = 0 And BNUD4.Value = 0 Then : SOP6_P.Image = My.Resources._1_124 : End If : SOP6_P.SizeMode = 4
  205. 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
  206. ElseIf 工程款5_nud.Value = 0 And BNUD5.Value = 0 Then : SOP7_P.Image = My.Resources._1_124 : End If : SOP7_P.SizeMode = 4
  207. PA = 合約編號_tb.Text : PA1 = ANUD3.Value : PA2 = ANUD2.Value : PA3 = ANUD4.Value : PA4 = ANUD5.Value : PA5 = BNUD1.Value : PA6 = BNUD2.Value
  208. PA7 = BNUD3.Value : PA8 = BNUD4.Value : PA9 = BNUD5.Value : SQL_控制表_請款修改()
  209. End Sub
  210. Private Sub 合約_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 合約_dgv.CellClick
  211. If e.RowIndex = -1 Then : Else
  212. 請款單號_tb.Text = "" : 請款期數_cb.Text = "" : 比例_nud.Value = 0 : 稅金_nud.Value = 0 : 請款金額_nud.Value = 0 : 請款總額_nud.Value = 0 : 付款期限_cb.Text = ""
  213. 報告移交計算()
  214. If 放大 = True Then : 縮放2_bt.PerformClick() : End If : 合約編號_tb.Text = 合約_dgv("合約編號", e.RowIndex).Value.ToString : PA = 合約編號_tb.Text : Set_合約報價總表()
  215. If 報價總表_dgv.Rows.Count > 0 Then
  216. For i As Integer = 0 To 報價總表_dgv.Rows.Count - 1
  217. If 報價總表_dgv.Rows(i).Cells("DESCRIPTION").Value.ToString = "稅金 10% Tax" Then : 稅額顯示_lb.Text = "PPN 10%稅額 = Rp. "
  218. ElseIf 報價總表_dgv.Rows(i).Cells("DESCRIPTION").Value.ToString = "稅金 11% Tax" Then : 稅額顯示_lb.Text = "PPN 11%稅額 = Rp. " : End If
  219. If 報價總表_dgv.Rows(i).Cells("DESCRIPTION").Value.ToString = "總計 Grand Total" Then : NUD3.Value = 報價總表_dgv.Rows(i).Cells("AMOUNT (RP)").Value : End If
  220. Next
  221. Else : 稅額顯示_lb.Text = "PPN 10%稅額 = Rp. " : End If
  222. B09_tb.Text = 合約_dgv("客戶地址", e.RowIndex).Value.ToString() : B24_tb.Text = "" : B25_tb.Text = "" : B26_tb.Text = ""
  223. If 合約_dgv("驗收完成日期", e.RowIndex).Value.ToString() <> "" Then
  224. DTP1.Value = 合約_dgv("驗收完成日期", e.RowIndex).Value.ToString() : B44_tb.Text = 合約_dgv.Rows(e.RowIndex).Cells("保固期限").Value.ToString
  225. Dim 保固日 As String = Strings.Format(DTP1.Value.AddMonths(CInt(合約_dgv.Rows(e.RowIndex).Cells("保固期限").Value.ToString)))
  226. B24_tb.Text = Strings.Right(Strings.Format(合約_dgv("驗收完成日期", e.RowIndex).Value.ToString()), 2)
  227. B26_tb.Text = Strings.Left(Strings.Format(合約_dgv("驗收完成日期", e.RowIndex).Value.ToString()), 4)
  228. If Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", e.RowIndex).Value.ToString()), 6, 2) = "01" Then : B25_tb.Text = "Jan"
  229. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", e.RowIndex).Value.ToString()), 6, 2) = "02" Then : B25_tb.Text = "Feb"
  230. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", e.RowIndex).Value.ToString()), 6, 2) = "03" Then : B25_tb.Text = "Ber"
  231. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", e.RowIndex).Value.ToString()), 6, 2) = "04" Then : B25_tb.Text = "Apr"
  232. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", e.RowIndex).Value.ToString()), 6, 2) = "05" Then : B25_tb.Text = "Mun"
  233. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", e.RowIndex).Value.ToString()), 6, 2) = "06" Then : B25_tb.Text = "Jun"
  234. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", e.RowIndex).Value.ToString()), 6, 2) = "07" Then : B25_tb.Text = "Jul"
  235. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", e.RowIndex).Value.ToString()), 6, 2) = "08" Then : B25_tb.Text = "Agu"
  236. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", e.RowIndex).Value.ToString()), 6, 2) = "09" Then : B25_tb.Text = "Sep"
  237. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", e.RowIndex).Value.ToString()), 6, 2) = "10" Then : B25_tb.Text = "Okt"
  238. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", e.RowIndex).Value.ToString()), 6, 2) = "11" Then : B25_tb.Text = "Nov"
  239. ElseIf Strings.Mid(Strings.Format(合約_dgv("驗收完成日期", e.RowIndex).Value.ToString()), 6, 2) = "12" Then : B25_tb.Text = "Des" : End If
  240. B27_tb.Text = Strings.Right(保固日, 2) : B29_tb.Text = Strings.Left(保固日, 4)
  241. If Strings.Mid(保固日, 6, 2) = "01" Then : B28_tb.Text = "Jan" : ElseIf Strings.Mid(保固日, 6, 2) = "02" Then : B28_tb.Text = "Feb"
  242. ElseIf Strings.Mid(保固日, 6, 2) = "03" Then : B28_tb.Text = "Ber" : ElseIf Strings.Mid(保固日, 6, 2) = "04" Then : B28_tb.Text = "Apr"
  243. ElseIf Strings.Mid(保固日, 6, 2) = "05" Then : B28_tb.Text = "Mun" : ElseIf Strings.Mid(保固日, 6, 2) = "06" Then : B28_tb.Text = "Jun"
  244. ElseIf Strings.Mid(保固日, 6, 2) = "07" Then : B28_tb.Text = "Jul" : ElseIf Strings.Mid(保固日, 6, 2) = "08" Then : B28_tb.Text = "Agu"
  245. ElseIf Strings.Mid(保固日, 6, 2) = "09" Then : B28_tb.Text = "Sep" : ElseIf Strings.Mid(保固日, 6, 2) = "10" Then : B28_tb.Text = "Okt"
  246. ElseIf Strings.Mid(保固日, 6, 2) = "11" Then : B28_tb.Text = "Nov" : ElseIf Strings.Mid(保固日, 6, 2) = "12" Then : B28_tb.Text = "Des" : End If
  247. End If
  248. 甲方_tb.Text = 合約_dgv("約號甲方", e.RowIndex).Value.ToString
  249. 客戶名稱_tb.Text = 合約_dgv("客戶名稱", e.RowIndex).Value.ToString : 工程名稱_英_tb.Text = 合約_dgv("工程名稱_英", e.RowIndex).Value.ToString
  250. 工程名稱_中_tb.Text = 合約_dgv("工程名稱_中", e.RowIndex).Value.ToString : 工程款1_nud.Value = 合約_dgv("第一期比例", e.RowIndex).Value
  251. 工程款2_nud.Value = 合約_dgv("第二期比例", e.RowIndex).Value : 工程款3_nud.Value = 合約_dgv("第三期比例", e.RowIndex).Value
  252. 工程款4_nud.Value = 合約_dgv("第四期比例", e.RowIndex).Value : 工程款5_nud.Value = 合約_dgv("第五期比例", e.RowIndex).Value
  253. CH2.Checked = True : NUD3.Value = 合約_dgv("工程總價", e.RowIndex).Value
  254. NUD3.Value = 合約_dgv("工程總價", e.RowIndex).Value : NUD6.Value = 0
  255. PA1 = "1" : Set_合約明細1() : PA1 = "2" : Set_合約明細2() : PA1 = "3" : Set_合約明細3() : PA1 = "4" : Set_合約明細4() : PA1 = "5" : Set_合約明細5()
  256. Set_附錄清單()
  257. If 合約附錄_dgv.Rows.Count > 0 Then
  258. NUD4.Value = 合約附錄_dgv("原金額", 0).Value : NUD5.Value = 合約附錄_dgv("追加減", 0).Value : 附錄編號_tb.Text = 合約附錄_dgv("附錄編號", 0).Value.ToString
  259. Else : NUD4.Value = 0 : NUD5.Value = 0 : 附錄編號_tb.Text = "" : End If
  260. Set_請款清單() : 請款計算() : NUD3.Value += 1 : NUD3.Value -= 1
  261. End If
  262. End Sub
  263. Private Sub 合約附錄_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 合約附錄_dgv.CellClick
  264. NUD4.Value = 合約附錄_dgv("原金額", e.RowIndex).Value : NUD5.Value = 合約附錄_dgv("追加減", e.RowIndex).Value
  265. 附錄編號_tb.Text = 合約附錄_dgv("附錄編號", e.RowIndex).Value.ToString : 請款計算()
  266. End Sub
  267. Private Sub 請款單_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 請款單_dgv.CellClick
  268. 請款單號_tb.Text = 請款單_dgv("請款編號", e.RowIndex).Value.ToString : 請款期數_cb.Text = 請款單_dgv("期數", e.RowIndex).Value.ToString
  269. 請款內容_tb.Text = 請款單_dgv("請款內容", e.RowIndex).Value.ToString : 比例_nud.Value = 請款單_dgv("比例", e.RowIndex).Value
  270. 請款金額_nud.Value = 請款單_dgv("請款金額", e.RowIndex).Value : 稅金_nud.Value = 請款單_dgv("稅金", e.RowIndex).Value
  271. 付款期限_cb.Text = 請款單_dgv("付款期限", e.RowIndex).Value.ToString : 申請日期_dtp.Value = 請款單_dgv("申請時間", e.RowIndex).Value
  272. 其他意見_tb.Text = 請款單_dgv("審批意見", e.RowIndex).Value.ToString : 請款總額_nud.Value = 請款單_dgv("請款總額", e.RowIndex).Value
  273. 報告移交計算()
  274. End Sub
  275. Private Sub 第1期_dgv_CellContentCl(sender As Object, e As DataGridViewCellEventArgs) Handles 第1期_dgv.CellEnter
  276. If Not IsNumeric(第1期_dgv.Rows(e.RowIndex).Cells("比例").Value) Then
  277. If 系統語言 = "繁體中文" Then : MsgBox("欄位輸入必須為數值!!") : Else : MsgBox("Input bidang harus numerik!!") : End If
  278. 第1期_dgv.Rows(e.RowIndex).Cells("比例").Value = "0" : 第1期_dgv.Rows(e.RowIndex).Cells("金額").Value = "0"
  279. Else
  280. Dim nn As Integer
  281. For i As Integer = 0 To 第1期_dgv.Rows.Count - 1 : nn += 第1期_dgv.Rows(i).Cells("比例").Value : Next
  282. If nn > 工程款1_nud.Value Then
  283. Dim SS As String
  284. If 系統語言 = "繁體中文" Then : SS = "第一期的細項比例不可大於 " : Else : SS = "Proporsi detail fase pertama tidak boleh lebih dari " : End If
  285. MsgBox(SS & Strings.Format(工程款1_nud.Value, "#,##0.00") & " % !!")
  286. 第1期_dgv.Rows(e.RowIndex).Cells("比例").Value = "0" : 第1期_dgv.Rows(e.RowIndex).Cells("金額").Value = "0"
  287. Else
  288. For i As Integer = 0 To 第1期_dgv.Rows.Count - 1
  289. 第1期_dgv.Rows(i).Cells("金額").Value = 第1期_dgv.Rows(i).Cells("比例").Value * 金額1_und.Value / 工程款1_nud.Value
  290. Next i
  291. End If
  292. End If
  293. End Sub
  294. Private Sub 第2期_dgv_CellContentCl(sender As Object, e As DataGridViewCellEventArgs) Handles 第2期_dgv.CellEnter
  295. If Not IsNumeric(第2期_dgv.Rows(e.RowIndex).Cells("比例").Value) Then
  296. If 系統語言 = "繁體中文" Then : MsgBox("欄位輸入必須為數值!!") : Else : MsgBox("Input bidang harus numerik!!") : End If
  297. 第2期_dgv.Rows(e.RowIndex).Cells("比例").Value = "0" : 第2期_dgv.Rows(e.RowIndex).Cells("金額").Value = "0"
  298. Else
  299. Dim nn As Integer
  300. For i As Integer = 0 To 第2期_dgv.Rows.Count - 1 : nn += 第2期_dgv.Rows(i).Cells("比例").Value : Next
  301. If nn > 工程款2_nud.Value Then
  302. Dim SS As String
  303. If 系統語言 = "繁體中文" Then : SS = "第二期的細項比例不可大於 " : Else : SS = "Proporsi detail fase kedua tidak boleh lebih besar dari " : End If
  304. MsgBox(SS & Strings.Format(工程款2_nud.Value, "#,##0.00") & " % !!")
  305. 第2期_dgv.Rows(e.RowIndex).Cells("比例").Value = "0" : 第2期_dgv.Rows(e.RowIndex).Cells("金額").Value = "0"
  306. Else
  307. For i As Integer = 0 To 第2期_dgv.Rows.Count - 1
  308. 第2期_dgv.Rows(i).Cells("金額").Value = 第2期_dgv.Rows(i).Cells("比例").Value * 金額2_und.Value / 工程款2_nud.Value
  309. Next i
  310. End If
  311. End If
  312. End Sub
  313. Private Sub 第3期_dgv_CellContentCl(sender As Object, e As DataGridViewCellEventArgs) Handles 第3期_dgv.CellEnter
  314. If Not IsNumeric(第3期_dgv.Rows(e.RowIndex).Cells("比例").Value) Then
  315. If 系統語言 = "繁體中文" Then : MsgBox("欄位輸入必須為數值!!") : Else : MsgBox("Input bidang harus numerik!!") : End If
  316. 第3期_dgv.Rows(e.RowIndex).Cells("比例").Value = "0" : 第3期_dgv.Rows(e.RowIndex).Cells("金額").Value = "0"
  317. Else
  318. Dim nn As Integer
  319. For i As Integer = 0 To 第3期_dgv.Rows.Count - 1 : nn += 第3期_dgv.Rows(i).Cells("比例").Value : Next
  320. If nn > 工程款3_nud.Value Then
  321. Dim SS As String
  322. If 系統語言 = "繁體中文" Then : SS = "第三期的細項比例不可大於 " : Else : SS = "Proporsi rincian periode ketiga tidak boleh lebih besar dari " : End If
  323. MsgBox(SS & Strings.Format(工程款3_nud.Value, "#,##0.00") & " % !!")
  324. 第3期_dgv.Rows(e.RowIndex).Cells("比例").Value = "0" : 第3期_dgv.Rows(e.RowIndex).Cells("金額").Value = "0"
  325. Else
  326. For i As Integer = 0 To 第3期_dgv.Rows.Count - 1
  327. 第3期_dgv.Rows(i).Cells("金額").Value = 第3期_dgv.Rows(i).Cells("比例").Value * 金額3_und.Value / 工程款3_nud.Value
  328. Next i
  329. End If
  330. End If
  331. End Sub
  332. Private Sub 第4期_dgv_CellContentCl(sender As Object, e As DataGridViewCellEventArgs) Handles 第4期_dgv.CellEnter
  333. If Not IsNumeric(第4期_dgv.Rows(e.RowIndex).Cells("比例").Value) Then
  334. If 系統語言 = "繁體中文" Then : MsgBox("欄位輸入必須為數值!!") : Else : MsgBox("Input bidang harus numerik!!") : End If
  335. 第4期_dgv.Rows(e.RowIndex).Cells("比例").Value = "0" : 第4期_dgv.Rows(e.RowIndex).Cells("金額").Value = "0"
  336. Else
  337. Dim nn As Integer
  338. For i As Integer = 0 To 第4期_dgv.Rows.Count - 1 : nn += 第4期_dgv.Rows(i).Cells("比例").Value : Next
  339. If nn > 工程款4_nud.Value Then
  340. Dim SS As String
  341. If 系統語言 = "繁體中文" Then : SS = "第四期的細項比例不可大於 " : Else : SS = "Proporsi rincian periode ke-4 tidak boleh lebih besar dari " : End If
  342. MsgBox(SS & Strings.Format(工程款4_nud.Value, "#,##0.00") & " % !!")
  343. 第4期_dgv.Rows(e.RowIndex).Cells("比例").Value = "0" : 第4期_dgv.Rows(e.RowIndex).Cells("金額").Value = "0"
  344. Else
  345. For i As Integer = 0 To 第4期_dgv.Rows.Count - 1
  346. 第4期_dgv.Rows(i).Cells("金額").Value = 第4期_dgv.Rows(i).Cells("比例").Value * 金額4_und.Value / 工程款4_nud.Value
  347. Next i
  348. End If
  349. End If
  350. End Sub
  351. Private Sub 第5期_dgv_CellContentCl(sender As Object, e As DataGridViewCellEventArgs) Handles 第5期_dgv.CellEnter
  352. If Not IsNumeric(第5期_dgv.Rows(e.RowIndex).Cells("比例").Value) Then
  353. If 系統語言 = "繁體中文" Then : MsgBox("欄位輸入必須為數值!!") : Else : MsgBox("Input bidang harus numerik!!") : End If
  354. 第5期_dgv.Rows(e.RowIndex).Cells("比例").Value = "0" : 第5期_dgv.Rows(e.RowIndex).Cells("金額").Value = "0"
  355. Else
  356. Dim nn As Integer
  357. For i As Integer = 0 To 第5期_dgv.Rows.Count - 1 : nn += 第5期_dgv.Rows(i).Cells("比例").Value : Next
  358. If nn > 工程款5_nud.Value Then
  359. Dim SS As String
  360. If 系統語言 = "繁體中文" Then : SS = "第五期的細項比例不可大於 " : Else : SS = "Proporsi rincian periode kelima tidak boleh lebih besar dari " : End If
  361. MsgBox(SS & Strings.Format(工程款5_nud.Value, "#,##0.00") & " % !!")
  362. 第5期_dgv.Rows(e.RowIndex).Cells("比例").Value = "0" : 第5期_dgv.Rows(e.RowIndex).Cells("金額").Value = "0"
  363. Else
  364. For i As Integer = 0 To 第5期_dgv.Rows.Count - 1
  365. 第5期_dgv.Rows(i).Cells("金額").Value = 第5期_dgv.Rows(i).Cells("比例").Value * 金額5_und.Value / 工程款5_nud.Value
  366. Next i
  367. End If
  368. End If
  369. End Sub
  370. Private Sub 第1期_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 第1期_dgv.CellClick
  371. If e.RowIndex = -1 Then : Else : 明細選項_bt.Text = 第1期_dgv("細項", e.RowIndex).Value.ToString : 明細選項_bt.Text = Strings.Format(Val(明細選項_bt.Text), "#,##0") : End If
  372. End Sub
  373. Private Sub 第2期_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 第2期_dgv.CellClick
  374. If e.RowIndex = -1 Then : Else : 明細選項_bt.Text = 第2期_dgv("細項", e.RowIndex).Value.ToString : 明細選項_bt.Text = Strings.Format(Val(明細選項_bt.Text), "#,##0") : End If
  375. End Sub
  376. Private Sub 第3期_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 第3期_dgv.CellClick
  377. If e.RowIndex = -1 Then : Else : 明細選項_bt.Text = 第3期_dgv("細項", e.RowIndex).Value.ToString : 明細選項_bt.Text = Strings.Format(Val(明細選項_bt.Text), "#,##0") : End If
  378. End Sub
  379. Private Sub 第4期_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 第4期_dgv.CellClick
  380. If e.RowIndex = -1 Then : Else : 明細選項_bt.Text = 第4期_dgv("細項", e.RowIndex).Value.ToString : 明細選項_bt.Text = Strings.Format(Val(明細選項_bt.Text), "#,##0") : End If
  381. End Sub
  382. Private Sub 第5期_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 第5期_dgv.CellClick
  383. If e.RowIndex = -1 Then : Else : 明細選項_bt.Text = 第5期_dgv("細項", e.RowIndex).Value.ToString : 明細選項_bt.Text = Strings.Format(Val(明細選項_bt.Text), "#,##0") : End If
  384. End Sub
  385. Private Sub 合約編號1_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 合約編號1_cb.SelectedIndexChanged
  386. Set_合約清單()
  387. End Sub
  388. Private Sub 工程期1_ch_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 工程期1_ch.SelectedIndexChanged
  389. Set_合約清單()
  390. End Sub
  391. Private Sub NUD3_ValueChanged(sender As Object, e As EventArgs) Handles NUD3.ValueChanged
  392. If CH2.Checked = True Then
  393. If 稅額顯示_lb.Text = "PPN 10%稅額 = Rp. " Then : NUD2.Value = NUD3.Value / 110 * 10 : Else : NUD2.Value = NUD3.Value / 111 * 11 : End If
  394. NUD1.Value = NUD3.Value - NUD2.Value
  395. 金額1_und.Value = NUD3.Value / 100 * 工程款1_nud.Value : 金額2_und.Value = NUD3.Value / 100 * 工程款2_nud.Value
  396. 金額3_und.Value = NUD3.Value / 100 * 工程款3_nud.Value : 金額4_und.Value = NUD3.Value / 100 * 工程款4_nud.Value
  397. 金額5_und.Value = NUD3.Value / 100 * 工程款5_nud.Value
  398. 金額6_und.Value = 金額1_und.Value + 金額2_und.Value + 金額3_und.Value + 金額4_und.Value + 金額5_und.Value
  399. End If
  400. End Sub
  401. Private Sub NUD1_ValueChanged(sender As Object, e As EventArgs) Handles NUD1.ValueChanged
  402. If CH1.Checked = True Then
  403. NUD2.Value = NUD1.Value / 100 * 10 : NUD3.Value = NUD1.Value + NUD2.Value
  404. 金額1_und.Value = NUD3.Value / 100 * 工程款1_nud.Value : 金額2_und.Value = NUD3.Value / 100 * 工程款2_nud.Value
  405. 金額3_und.Value = NUD3.Value / 100 * 工程款3_nud.Value : 金額4_und.Value = NUD3.Value / 100 * 工程款4_nud.Value
  406. 金額5_und.Value = NUD3.Value / 100 * 工程款5_nud.Value
  407. 金額6_und.Value = 金額1_und.Value + 金額2_und.Value + 金額3_und.Value + 金額4_und.Value + 金額5_und.Value
  408. End If
  409. End Sub
  410. Private Sub CH1_CheckedChanged(sender As Object, e As EventArgs) Handles CH1.Click
  411. CH1.Checked = True : CH2.Checked = False : NUD1.Enabled = True : NUD3.Enabled = False
  412. End Sub
  413. Private Sub CH2_CheckedChanged(sender As Object, e As EventArgs) Handles CH2.Click
  414. CH1.Checked = False : CH2.Checked = True : NUD1.Enabled = False : NUD3.Enabled = True
  415. End Sub
  416. Private Sub 工程款1_nud_ValueChanged(sender As Object, e As EventArgs) Handles 工程款1_nud.ValueChanged
  417. 工程款6_nud.Value = 工程款1_nud.Value + 工程款2_nud.Value + 工程款3_nud.Value + 工程款4_nud.Value + 工程款5_nud.Value
  418. 金額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
  419. End Sub
  420. Private Sub 工程款2_nud_ValueChanged(sender As Object, e As EventArgs) Handles 工程款2_nud.ValueChanged
  421. 工程款6_nud.Value = 工程款1_nud.Value + 工程款2_nud.Value + 工程款3_nud.Value + 工程款4_nud.Value + 工程款5_nud.Value
  422. 金額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
  423. End Sub
  424. Private Sub 工程款3_nud_ValueChanged(sender As Object, e As EventArgs) Handles 工程款3_nud.ValueChanged
  425. 工程款6_nud.Value = 工程款1_nud.Value + 工程款2_nud.Value + 工程款3_nud.Value + 工程款4_nud.Value + 工程款5_nud.Value
  426. 金額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
  427. End Sub
  428. Private Sub 工程款4_nud_ValueChanged(sender As Object, e As EventArgs) Handles 工程款4_nud.ValueChanged
  429. 工程款6_nud.Value = 工程款1_nud.Value + 工程款2_nud.Value + 工程款3_nud.Value + 工程款4_nud.Value + 工程款5_nud.Value
  430. 金額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
  431. End Sub
  432. Private Sub 工程款5_nud_ValueChanged(sender As Object, e As EventArgs) Handles 工程款5_nud.ValueChanged
  433. 工程款6_nud.Value = 工程款1_nud.Value + 工程款2_nud.Value + 工程款3_nud.Value + 工程款4_nud.Value + 工程款5_nud.Value
  434. 金額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
  435. End Sub
  436. Private Sub NUD4_ValueChanged(sender As Object, e As EventArgs) Handles NUD4.ValueChanged
  437. NUD6.Value = NUD4.Value + NUD5.Value
  438. End Sub
  439. Private Sub NUD5_ValueChanged(sender As Object, e As EventArgs) Handles NUD5.ValueChanged
  440. NUD6.Value = NUD4.Value + NUD5.Value
  441. End Sub
  442. Private Sub 比例_nud_ValueChanged(sender As Object, e As EventArgs) Handles 比例_nud.ValueChanged
  443. 請款金額_nud.Value = NUD1.Value / 100 * 比例_nud.Value
  444. End Sub
  445. Private Sub 稅金_nud_ValueChanged(sender As Object, e As EventArgs) Handles 稅金_nud.ValueChanged
  446. 請款總額_nud.Value = 請款金額_nud.Value / 100 * 稅金_nud.Value + 請款金額_nud.Value
  447. End Sub
  448. Private Sub 請款金額_nud_ValueChanged(sender As Object, e As EventArgs) Handles 請款金額_nud.ValueChanged
  449. If 請款金額_nud.Value / NUD1.Value * 100 > 100 Then : 比例_nud.Value = 100 : Else : 比例_nud.Value = 請款金額_nud.Value / NUD1.Value * 100 : End If
  450. 請款總額_nud.Value = 請款金額_nud.Value / 100 * 稅金_nud.Value + 請款金額_nud.Value
  451. End Sub
  452. Private Sub 請款總額_nud_ValueChanged(sender As Object, e As EventArgs) Handles 請款總額_nud.ValueChanged
  453. 請款金額_nud.Value = 請款總額_nud.Value / (100 + 稅金_nud.Value) * 100
  454. End Sub
  455. Private Sub 請款期數_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 請款期數_cb.SelectedIndexChanged
  456. If 請款期數_cb.Text = "" Then : 比例_nud.Value = 0
  457. ElseIf 請款期數_cb.Text = "一" Then
  458. 比例_nud.Value = 工程款1_nud.Value : 請款內容_tb.Text = "Prepayments 預付款" : 主頁明細_ch.Checked = False : 報告移交單_ch.Checked = False
  459. ElseIf 請款期數_cb.Text = "二" Then
  460. 比例_nud.Value = 工程款2_nud.Value : 請款內容_tb.Text = "Material Cost Application 材料到貨款" : 主頁明細_ch.Checked = False : 報告移交單_ch.Checked = False
  461. ElseIf 請款期數_cb.Text = "三" Then
  462. 比例_nud.Value = 工程款3_nud.Value : 請款內容_tb.Text = "Installation Fee Application 施工請款 " : 主頁明細_ch.Checked = False : 報告移交單_ch.Checked = False
  463. ElseIf 請款期數_cb.Text = "四" Then
  464. 比例_nud.Value = 工程款4_nud.Value : 請款內容_tb.Text = "Final Acceptance 驗收款 " : 主頁明細_ch.Checked = True : 報告移交單_ch.Checked = True
  465. ElseIf 請款期數_cb.Text = "五" Then
  466. 比例_nud.Value = 工程款5_nud.Value : 請款內容_tb.Text = "Assure 保留款 " : 主頁明細_ch.Checked = False : 報告移交單_ch.Checked = True
  467. End If
  468. End Sub
  469. Private Sub 新增資料_bt_Click(sender As Object, e As EventArgs) Handles 新增資料_bt.Click
  470. If 合約編號_tb.Text = "" Then
  471. If 系統語言 = "繁體中文" Then : MsgBox("資訊不夠,無法生成明細!!") : Else : MsgBox("Tidak cukup informasi untuk menghasilkan detail!!") : End If : Else
  472. If 工程款6_nud.Value <> 100 Then
  473. If 系統語言 = "繁體中文" Then : MsgBox("工程款估驗 不等於 100%!!") : Else : MsgBox("Penilaian biaya proyek tidak sama dengan 100%!!") : End If : Else
  474. PA = 合約編號_tb.Text : 合約明細存檔()
  475. Dim SS As String
  476. If 系統語言 = "繁體中文" Then : SS = "合約工期款項細分不可大於10筆!!" : Else : SS = "Pembagian pembayaran durasi kontrak tidak boleh lebih dari 10 !!" : End If
  477. If TabControl2.SelectedIndex = 0 Then
  478. If 第1期_dgv.Rows.Count = 10 Then : MsgBox(SS) : Else : PA1 = "1" : PA2 = 第1期_dgv.Rows.Count + 1 : SQL_合約明細新增() : End If
  479. ElseIf TabControl2.SelectedIndex = 1 Then
  480. If 第2期_dgv.Rows.Count = 10 Then : MsgBox(SS) : Else : PA1 = "2" : PA2 = 第2期_dgv.Rows.Count + 1 : SQL_合約明細新增() : End If
  481. ElseIf TabControl2.SelectedIndex = 2 Then
  482. If 第3期_dgv.Rows.Count = 10 Then : MsgBox(SS) : Else : PA1 = "3" : PA2 = 第3期_dgv.Rows.Count + 1 : SQL_合約明細新增() : End If
  483. ElseIf TabControl2.SelectedIndex = 3 Then
  484. If 第4期_dgv.Rows.Count = 10 Then : MsgBox(SS) : Else : PA1 = "4" : PA2 = 第4期_dgv.Rows.Count + 1 : SQL_合約明細新增() : End If
  485. ElseIf TabControl2.SelectedIndex = 4 Then
  486. If 第5期_dgv.Rows.Count = 10 Then : MsgBox(SS) : Else : PA1 = "5" : PA2 = 第5期_dgv.Rows.Count + 1 : SQL_合約明細新增() : End If
  487. End If
  488. PA = 合約編號_tb.Text
  489. PA1 = "1" : Set_合約明細1() : PA1 = "2" : Set_合約明細2() : PA1 = "3" : Set_合約明細3() : PA1 = "4" : Set_合約明細4() : PA1 = "5" : Set_合約明細5() : MsgBox("新增完成!!")
  490. End If
  491. End If
  492. End Sub
  493. Private Sub 刪除資料_bt_Click(sender As Object, e As EventArgs) Handles 刪除資料_bt.Click
  494. If 合約編號_tb.Text = "" Or 明細選項_bt.Text = "" Then
  495. If 系統語言 = "繁體中文" Then : MsgBox("資訊不夠,無法生成明細!!") : Else : MsgBox("Tidak cukup informasi untuk menghasilkan detail!!") : End If : Else
  496. If 工程款6_nud.Value <> 100 Then
  497. If 系統語言 = "繁體中文" Then : MsgBox("工程款估驗 不等於 100%!!") : Else : MsgBox("Penilaian biaya proyek tidak sama dengan 100%!!") : End If : Else
  498. PA = 合約編號_tb.Text
  499. If TabControl2.SelectedIndex = 0 Then : PA1 = "1" : PA2 = 明細選項_bt.Text : SQL_合約明細刪除()
  500. ElseIf TabControl2.SelectedIndex = 1 Then : PA1 = "2" : PA2 = 明細選項_bt.Text : SQL_合約明細刪除()
  501. ElseIf TabControl2.SelectedIndex = 2 Then : PA1 = "3" : PA2 = 明細選項_bt.Text : SQL_合約明細刪除()
  502. ElseIf TabControl2.SelectedIndex = 3 Then : PA1 = "4" : PA2 = 明細選項_bt.Text : SQL_合約明細刪除()
  503. ElseIf TabControl2.SelectedIndex = 4 Then : PA1 = "5" : PA2 = 明細選項_bt.Text : SQL_合約明細刪除()
  504. End If
  505. PA = 合約編號_tb.Text
  506. PA1 = "1" : Set_合約明細1() : PA1 = "2" : Set_合約明細2() : PA1 = "3" : Set_合約明細3() : PA1 = "4" : Set_合約明細4() : PA1 = "5" : Set_合約明細5() : MsgBox("刪除完成!!")
  507. End If
  508. End If
  509. End Sub
  510. Private Sub 存檔_tb_Click(sender As Object, e As EventArgs) Handles 存檔_tb.Click
  511. 合約明細存檔() : If 系統語言 = "繁體中文" Then : MsgBox("存檔完成!!") : Else : MsgBox("Arsip selesai!!") : End If
  512. End Sub
  513. Private Sub 合約明細存檔()
  514. For i As Integer = 0 To 第1期_dgv.Rows.Count - 1
  515. PA1 = "1" : PA2 = 第1期_dgv.Rows(i).Cells("細項").Value : PA3 = 第1期_dgv.Rows(i).Cells("內容").Value
  516. NU1 = 第1期_dgv.Rows(i).Cells("比例").Value : NU2 = 第1期_dgv.Rows(i).Cells("金額").Value : SQL_合約明細修改()
  517. Next
  518. For i As Integer = 0 To 第2期_dgv.Rows.Count - 1
  519. PA1 = "2" : PA2 = 第2期_dgv.Rows(i).Cells("細項").Value : PA3 = 第2期_dgv.Rows(i).Cells("內容").Value
  520. NU1 = 第2期_dgv.Rows(i).Cells("比例").Value : NU2 = 第2期_dgv.Rows(i).Cells("金額").Value : SQL_合約明細修改()
  521. Next
  522. For i As Integer = 0 To 第3期_dgv.Rows.Count - 1
  523. PA1 = "3" : PA2 = 第3期_dgv.Rows(i).Cells("細項").Value : PA3 = 第3期_dgv.Rows(i).Cells("內容").Value
  524. NU1 = 第3期_dgv.Rows(i).Cells("比例").Value : NU2 = 第3期_dgv.Rows(i).Cells("金額").Value : SQL_合約明細修改()
  525. Next
  526. For i As Integer = 0 To 第4期_dgv.Rows.Count - 1
  527. PA1 = "4" : PA2 = 第4期_dgv.Rows(i).Cells("細項").Value : PA3 = 第4期_dgv.Rows(i).Cells("內容").Value
  528. NU1 = 第4期_dgv.Rows(i).Cells("比例").Value : NU2 = 第4期_dgv.Rows(i).Cells("金額").Value : SQL_合約明細修改()
  529. Next
  530. For i As Integer = 0 To 第5期_dgv.Rows.Count - 1
  531. PA1 = "5" : PA2 = 第5期_dgv.Rows(i).Cells("細項").Value : PA3 = 第5期_dgv.Rows(i).Cells("內容").Value
  532. NU1 = 第5期_dgv.Rows(i).Cells("比例").Value : NU2 = 第5期_dgv.Rows(i).Cells("金額").Value : SQL_合約明細修改()
  533. Next
  534. End Sub
  535. Private Sub 查詢_bt_Click(sender As Object, e As EventArgs) Handles 查詢_bt.Click
  536. PA = 關鍵字搜尋_tb.Text : Set_合約清單()
  537. End Sub
  538. Private Sub 開新的請款單_bt_Click(sender As Object, e As EventArgs) Handles 開新的請款單_bt.Click
  539. If 合約編號_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("請先選擇合約!!") : Else : MsgBox("Silakan pilih kontrak terlebih dahulu!!") : End If : Else
  540. SQL_請款單_最後一筆資料()
  541. If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("請款編號").ToString, 9)) : Else : EDR = 0 : End If
  542. conn.Close() : EDR += 1
  543. If EDR < 10 Then : ESTR = "HP" & "00000000" & EDR
  544. ElseIf EDR > 9 And EDR < 100 Then : ESTR = "HP" & "0000000" & EDR
  545. ElseIf EDR > 99 And EDR < 1000 Then : ESTR = "HP" & "000000" & EDR
  546. ElseIf EDR > 999 And EDR < 10000 Then : ESTR = "HP" & "00000" & EDR
  547. ElseIf EDR > 9999 And EDR < 100000 Then : ESTR = "HP" & "0000" & EDR
  548. ElseIf EDR > 99999 And EDR < 100000 Then : ESTR = "HP" & "000" & EDR
  549. ElseIf EDR > 999999 And EDR < 1000000 Then : ESTR = "HP" & "00" & EDR
  550. ElseIf EDR > 9999999 And EDR < 10000000 Then : ESTR = "HP" & "0" & EDR
  551. ElseIf EDR > 99999999 Then : ESTR = "HP" & EDR : End If
  552. 請款單號_tb.Text = ESTR : 請款期數_cb.Text = "" : 比例_nud.Value = 0 : 稅金_nud.Value = 11
  553. 付款期限_cb.Text = "" : 申請日期_dtp.Value = Today()
  554. End If
  555. End Sub
  556. Private Sub 存檔_bt_Click(sender As Object, e As EventArgs) Handles 存檔_bt.Click
  557. If 合約編號_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("請先選擇合約!!") : Else : MsgBox("Silakan pilih kontrak terlebih dahulu!!") : End If : Else
  558. If 請款單號_tb.Text = "" Then
  559. If 系統語言 = "繁體中文" Then : MsgBox("請先案開新請款單或是選擇舊請款單!!") : Else : MsgBox("Silahkan pilih buka invoice baru atau pilih invoice lama dulu!!") : End If : Else
  560. If 請款期數_cb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("請先選擇請款期數!!") : Else : MsgBox("Silahkan pilih yang mana!!") : End If : Else
  561. If 請款金額_nud.Value = 0 Then : If 系統語言 = "繁體中文" Then : MsgBox("請款金額不可為零!!") : Else : MsgBox("Jumlah yang diminta tidak boleh nol!!") : End If : Else
  562. If 付款期限_cb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("沒有指定付款期限!!") : Else : MsgBox("Tidak ada batas waktu pembayaran yang ditentukan!!") : End If : Else
  563. PA = 合約編號_tb.Text : PA1 = 請款單號_tb.Text : PA2 = 請款期數_cb.Text : PA3 = 請款內容_tb.Text : PA4 = 請款金額_nud.Value : PA5 = 稅金_nud.Value
  564. PA6 = 付款期限_cb.Text : PA7 = Strings.Format(申請日期_dtp.Value, "yyyy/MM/dd") : PA8 = 其他意見_tb.Text : PA9 = 請款總額_nud.Value : PA10 = 比例_nud.Value
  565. SQL_請款單_最後一筆資料1()
  566. If dr.Read() Then : SQL_請款單_修改()
  567. Else
  568. If 請款金額_nud.Value > ANUD5.Value Then
  569. If 系統語言 = "繁體中文" Then : MsgBox("請款單大於剩餘款,無法新增請款單!!")
  570. Else : MsgBox("Permintaan lebih besar dari jumlah yang tersisa dan tidak dapat ditambahkan!!") : End If : Else
  571. SQL_請款單_新增()
  572. End If
  573. End If : Set_請款清單() : 請款計算() : If 系統語言 = "繁體中文" Then : MsgBox("存檔完成!!") : Else : MsgBox("Arsip selesai!!") : End If
  574. End If
  575. End If
  576. End If
  577. End If
  578. End If
  579. End Sub
  580. Private Sub 刪除_bt_Click(sender As Object, e As EventArgs) Handles 刪除_bt.Click
  581. If 合約編號_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("請先選擇合約!!") : Else : MsgBox("Silakan pilih kontrak terlebih dahulu!!") : End If : Else
  582. If 請款單號_tb.Text = "" Then : If 系統語言 = "繁體中文" Then : MsgBox("請先選擇請款單!!") : Else : MsgBox("Silakan pilih faktur terlebih dahulu!!") : End If : Else
  583. PA1 = 請款單號_tb.Text : SQL_請款單_刪除() : Set_請款清單() : 請款計算()
  584. If 系統語言 = "繁體中文" Then : MsgBox("合約請款單刪除完成!!") : Else : MsgBox("hapus selesai!!") : End If
  585. End If
  586. End If
  587. End Sub
  588. Private Sub 報告移交()
  589. B02_tb.Text = Strings.Right(Strings.Format(Today(), "yyyy/MM/dd"), 2) : B04_tb.Text = Strings.Left(Strings.Format(Today(), "yyyy/MM/dd"), 4)
  590. If Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "01" Then : B03_tb.Text = "Jan"
  591. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "02" Then : B03_tb.Text = "Feb"
  592. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "03" Then : B03_tb.Text = "Ber"
  593. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "04" Then : B03_tb.Text = "Apr"
  594. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "05" Then : B03_tb.Text = "Mun"
  595. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "06" Then : B03_tb.Text = "Jun"
  596. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "07" Then : B03_tb.Text = "Jul"
  597. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "08" Then : B03_tb.Text = "Agu"
  598. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "09" Then : B03_tb.Text = "Sep"
  599. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "10" Then : B03_tb.Text = "Okt"
  600. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "11" Then : B03_tb.Text = "Nov"
  601. ElseIf Strings.Mid(Strings.Format(Today(), "yyyy/MM/dd"), 6, 2) = "12" Then : B03_tb.Text = "Des" : End If
  602. B36_tb.Text = B02_tb.Text : B37_tb.Text = B03_tb.Text : B38_tb.Text = B04_tb.Text
  603. 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
  604. If Strings.Left(合約編號_tb.Text, 2) = "HX" Then : B12_tb.Text = "PT HONG XHE INDUSTRIAL" : B43_tb.Text = "PT HONG XHE INDUSTRIAL"
  605. Else : B12_tb.Text = "PT PUNCAK GEMILANG SEMESTA" : B43_tb.Text = "PT PUNCAK GEMILANG SEMESTA" : End If
  606. End Sub
  607. Private Sub 報告移交計算()
  608. If 請款期數_cb.Text = "四" Then
  609. Dim SS As Integer = 0
  610. For i As Integer = 0 To 請款單_dgv.Rows.Count - 1 : If 請款單_dgv("期數", i).Value.ToString() <> "五" Then : SS += 請款單_dgv("比例", i).Value : End If : Next
  611. B32_tb.Text = "Pihak kesatu (I) telah memeriksa hasil pekerjaan Pihak kedua (II) yang telah selesai dikerjakan sesuai dengan kontrak."
  612. A01_lb.Text = "BERITA ACARA SERAH TERIMA PERTAMA" : B31_tb.Text = "Penagihan Invoice Pelunasan " & SS & "%" : 報告移交()
  613. B19_tb.Visible = True : B27_tb.Visible = True : B28_tb.Visible = True : B29_tb.Visible = True : B33_tb.Visible = True
  614. B44_tb.Visible = True : B45_tb.Visible = True : B46_tb.Visible = True : 報告移交單_ch.Enabled = True
  615. ElseIf 請款期數_cb.Text = "五" Then
  616. B32_tb.Text = "Pihak kesatu (I) telah memeriksa hasil pekerjaan Pihak kedua (II) yang telah selesai dikerjakan dan dinyatakan 100% selesai dalam masa garansi."
  617. A01_lb.Text = "BERITA ACARA SERAH TERIMA KEDUA" : B31_tb.Text = "Penagihan Invoice Pelunasan 100%" : 報告移交()
  618. B19_tb.Visible = False : B27_tb.Visible = False : B28_tb.Visible = False : B29_tb.Visible = False : B33_tb.Visible = False
  619. B44_tb.Visible = False : B45_tb.Visible = False : B46_tb.Visible = False : 報告移交單_ch.Enabled = True
  620. Else
  621. 視窗2_pl.Visible = False : 報告移交單_ch.Enabled = False : 報告移交單_ch.Checked = False
  622. End If
  623. End Sub
  624. Private Sub 報告移交_bt_Click(sender As Object, e As EventArgs) Handles 報告移交_bt.Click
  625. If 視窗2_pl.Visible = False Then : 視窗2_pl.BringToFront()
  626. If 請款期數_cb.Text = "四" Then : 視窗2_pl.Location = New System.Drawing.Point(261, 19) : 視窗2_pl.Visible = True : 報告移交計算()
  627. ElseIf 請款期數_cb.Text = "五" Then : 視窗2_pl.Location = New System.Drawing.Point(261, 19) : 視窗2_pl.Visible = True : 報告移交計算()
  628. Else : 視窗2_pl.Visible = False : 報告移交單_ch.Checked = False
  629. If 系統語言 = "繁體中文" Then : MsgBox("所選請款期數,無法列印報告移交單!!")
  630. Else : MsgBox("Periode pengambilan yang dipilih tidak dapat mencetak slip serah terima laporan!!") : End If : End If
  631. Else : 視窗2_pl.Visible = False : End If
  632. End Sub
  633. Private Sub CanceL2_bt_Click(sender As Object, e As EventArgs) Handles CanceL2_bt.Click
  634. If 視窗2_pl.Visible = False Then : 視窗2_pl.Visible = True : 視窗2_pl.BringToFront() : Else
  635. 視窗2_pl.Visible = False : End If
  636. End Sub
  637. Private Sub 視窗2_pl_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 視窗2_pl.MouseDown
  638. If e.Button = MouseButtons.Left Then : OldX = e.X : OldY = e.Y : drag = True : End If
  639. End Sub
  640. Private Sub 視窗2_pl_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 視窗2_pl.MouseMove
  641. If drag Then : 視窗2_pl.Left = 視窗2_pl.Left + e.X - OldX : 視窗2_pl.Top = 視窗2_pl.Top + e.Y - OldY : End If
  642. End Sub
  643. Private Sub 縮放2_bt_Click(sender As Object, e As EventArgs) Handles 縮放2_bt.Click
  644. Dim NX, NY As Integer : NX = 合約_dgv.Size.Width : NY = 合約_dgv.Size.Height
  645. If 放大 = True Then
  646. 合約_dgv.Size = New System.Drawing.Point(NX - 400, NY) : 放大 = False : 合約_dgv.Columns("工程名稱_中").Visible = False
  647. Else
  648. 合約_dgv.Size = New System.Drawing.Point(NX + 400, NY) : 放大 = True : 合約_dgv.Columns("工程名稱_中").Visible = True
  649. End If
  650. End Sub
  651. Private Sub 視窗2_pl_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 視窗2_pl.MouseUp
  652. drag = False
  653. End Sub
  654. Private Sub 列印_bt_Click(sender As Object, e As EventArgs) Handles 列印_bt.Click
  655. If 合約編號_tb.Text = "" Then
  656. If 系統語言 = "繁體中文" Then : MsgBox("請先選擇合約!!") : Else : MsgBox("Silakan pilih kontrak terlebih dahulu!!") : End If : Else
  657. If 請款單號_tb.Text = "" Then
  658. If 系統語言 = "繁體中文" Then : MsgBox("請先選擇請款單!!") : Else : MsgBox("Silakan pilih faktur terlebih dahulu!!") : End If : Else
  659. If 請款期數_cb.Text = "" Then
  660. If 系統語言 = "繁體中文" Then : MsgBox("沒有請款期數,無法列印!!") : Else : MsgBox("Tidak ada waktu pembayaran, tidak dapat mencetak!!") : End If : Else
  661. If 請款金額_nud.Value = 0 Then
  662. If 系統語言 = "繁體中文" Then : MsgBox("請款金額為零,無法列印!!") : Else : MsgBox("Jumlah yang diminta adalah nol dan tidak dapat dicetak!!") : End If : Else
  663. If 付款期限_cb.Text = "" Then
  664. If 系統語言 = "繁體中文" Then : MsgBox("沒有指定付款期限,無法列印!!") : Else : MsgBox("Tidak ada waktu pembayaran, tidak dapat mencetak!!") : End If : Else
  665. Try
  666. xlApp = CType(CreateObject("Excel.Application"), Application)
  667. xlApp.Visible = True
  668. xlApp.DisplayAlerts = True
  669. xlApp.Application.WindowState = xlMaximized
  670. xlBook = xlApp.Workbooks.Add
  671. '----------------------------------------------------------------------------------------------------------------------
  672. If 報告移交單_ch.Checked = True Then
  673. xlSheet = NewMethod(xlBook) : xlApp.Sheets(1).Select : xlApp.Sheets(1).Name = "報告移交單"
  674. xlBook.Activate() : xlSheet.Activate()
  675. 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
  676. 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
  677. 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
  678. xlSheet.Cells(12, 3) = B14_tb.Text : xlSheet.Cells(14, 1) = B15_tb.Text
  679. xlSheet.Cells(16, 2) = B16_tb.Text : xlSheet.Cells(16, 3) = "':" : xlSheet.Cells(16, 4) = B22_tb.Text
  680. xlSheet.Cells(17, 2) = B17_tb.Text : xlSheet.Cells(17, 3) = "':" : xlSheet.Cells(17, 4) = B23_tb.Text
  681. xlSheet.Cells(18, 2) = B18_tb.Text : xlSheet.Cells(18, 3) = "':" : xlSheet.Cells(18, 4) = B24_tb.Text & " " & B25_tb.Text & " " & B26_tb.Text
  682. Dim NX As Integer = 19
  683. If 請款期數_cb.Text = "四" Then
  684. 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
  685. xlSheet.Cells(NX, 2) = B20_tb.Text : xlSheet.Cells(NX, 3) = "':" : xlSheet.Cells(NX, 4) = B30_tb.Text : NX += 1
  686. xlSheet.Cells(NX, 2) = B21_tb.Text : xlSheet.Cells(NX, 3) = "':" : xlSheet.Cells(NX, 4) = B31_tb.Text : NX += 2
  687. xlSheet.Cells(NX, 1) = B32_tb.Text : NX += 1
  688. xlSheet.Cells(NX, 1) = B33_tb.Text + " " + B44_tb.Text + " " + B45_tb.Text + " " & B46_tb.Text : NX += 1
  689. xlSheet.Cells(NX, 1) = B34_tb.Text : NX += 2
  690. xlSheet.Cells(NX, 4) = B35_tb.Text : xlSheet.Cells(NX, 5) = B36_tb.Text & " " & B37_tb.Text & " " & B38_tb.Text : NX += 2
  691. xlSheet.Cells(NX, 5) = B39_tb.Text : NX += 1
  692. xlSheet.Cells(NX, 2) = B40_tb.Text : xlSheet.Cells(NX, 5) = B41_tb.Text : NX += 1
  693. xlSheet.Cells(NX, 2) = B42_tb.Text : xlSheet.Cells(NX, 5) = B43_tb.Text
  694. Else
  695. xlSheet.Cells(NX, 2) = B20_tb.Text : xlSheet.Cells(NX, 3) = "':" : xlSheet.Cells(NX, 4) = B30_tb.Text : NX += 1
  696. xlSheet.Cells(NX, 2) = B21_tb.Text : xlSheet.Cells(NX, 3) = "':" : xlSheet.Cells(NX, 4) = B31_tb.Text : NX += 2
  697. xlSheet.Cells(NX, 1) = B32_tb.Text : NX += 1 : xlSheet.Cells(NX, 1) = B34_tb.Text : NX += 2
  698. xlSheet.Cells(NX, 4) = B35_tb.Text : xlSheet.Cells(NX, 5) = B36_tb.Text & " " & B37_tb.Text & " " & B38_tb.Text : NX += 2
  699. xlSheet.Cells(NX, 5) = B39_tb.Text : NX += 1
  700. xlSheet.Cells(NX, 2) = B40_tb.Text : xlSheet.Cells(NX, 5) = B41_tb.Text : NX += 1
  701. xlSheet.Cells(NX, 2) = B42_tb.Text : xlSheet.Cells(NX, 5) = B43_tb.Text
  702. End If
  703. AB(xlApp, xlSheet)
  704. If Strings.Left(合約編號_tb.Text, 2) = "HX" Then : CC(xlApp, xlSheet) : Else : DD(xlApp, xlSheet) : End If : FF(xlApp, xlSheet)
  705. End If
  706. '----------------------------------------------------------------------------------------------------------------------
  707. If 請款單_ch.Checked = True Then
  708. xlSheet = NewMethod(xlBook) : xlApp.Sheets(1).Select : xlApp.Sheets(1).Name = "請款單"
  709. xlBook.Activate() : xlSheet.Activate()
  710. xlSheet.Cells(2, 1) = "請款明細表 Rincian Tagihan" : xlSheet.Cells(3, 1) = "TO : " & 客戶名稱_tb.Text
  711. xlSheet.Cells(3, 9) = "日期 : " & Strings.Format(Today(), "yyyy/MM/dd")
  712. xlSheet.Cells(4, 1) = "工程項目 : " & 工程名稱_中_tb.Text & vbCrLf & 工程名稱_英_tb.Text : xlSheet.Cells(4, 9) = "期別 : 第" & 請款期數_cb.Text & "期"
  713. xlSheet.Cells(5, 1) = "(未稅)本合約工程款 Total Kontrak Sebelum Ppn Rp : "
  714. 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
  715. xlSheet.Cells(7, 1) = "No." : xlSheet.Cells(7, 2) = "Description" : xlSheet.Cells(7, 3) = "Rate" : xlSheet.Cells(7, 4) = "Total Amount" & vbCrLf & "總金額"
  716. xlSheet.Cells(7, 5) = "This Period" & vbCrLf & "本期請款" : xlSheet.Cells(7, 7) = "Accumulation" & vbCrLf & "累計請款" : xlSheet.Cells(7, 9) = "Remarks"
  717. If 新版_ch.Checked = False Then
  718. xlSheet.Cells(8, 1) = "1" : xlSheet.Cells(8, 2) = "Prepayments" & vbCrLf & "(預付款)" : xlSheet.Cells(8, 3) = 工程款1_nud.Value / 100
  719. If 請款期數_cb.Text = "一" Then : xlSheet.Cells(8, 5) = "=C8" : Else : xlSheet.Cells(8, 5) = "0" : End If
  720. xlSheet.Cells(9, 1) = "2" : xlSheet.Cells(9, 2) = "Material Cost Application" & vbCrLf & "(材料到貨款)" : xlSheet.Cells(9, 3) = 工程款2_nud.Value / 100
  721. If 請款期數_cb.Text = "二" Then : xlSheet.Cells(9, 5) = "=C9" : Else : xlSheet.Cells(9, 5) = "0" : End If
  722. xlSheet.Cells(10, 1) = "3" : xlSheet.Cells(10, 2) = "Installation Fee Application" & vbCrLf & "(施工請款)" : xlSheet.Cells(10, 3) = 工程款3_nud.Value / 100
  723. If 請款期數_cb.Text = "三" Then : xlSheet.Cells(10, 5) = "=C10" : Else : xlSheet.Cells(10, 5) = "0" : End If
  724. xlSheet.Cells(11, 1) = "4" : xlSheet.Cells(11, 2) = "Final Acceptance" & vbCrLf & "(驗收款)" : xlSheet.Cells(11, 3) = 工程款4_nud.Value / 100
  725. If 請款期數_cb.Text = "四" Then : xlSheet.Cells(11, 5) = "=C11" : Else : xlSheet.Cells(11, 5) = "0" : End If
  726. xlSheet.Cells(12, 1) = "5" : xlSheet.Cells(12, 2) = "Assure" & vbCrLf & "(保留款)" : xlSheet.Cells(12, 3) = 工程款5_nud.Value / 100
  727. If 請款期數_cb.Text = "五" Then : xlSheet.Cells(12, 5) = "=C12" : Else : xlSheet.Cells(12, 5) = "0" : End If
  728. For i As Integer = 8 To 12
  729. 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
  730. xlSheet.Cells(i, 6) = "=IF(E" & i & "=0,0,D" & i & ")" : If i = 8 Then : xlSheet.Cells(i, 7) = "=IF(E" & i & "=0,C" & i & ",0)"
  731. Else : xlSheet.Cells(i, 7) = "=IF(G" & i - 1 & "=0,0,IF(E" & i & "=0,C" & i & ",0))" : End If
  732. xlSheet.Cells(i, 8) = "=G" & i & "*$E$5"
  733. Next
  734. xlSheet.Cells(13, 1) = "Total" : xlSheet.Cells(13, 4) = "=D12+D11+D10+D9+D8" : xlSheet.Cells(13, 5) = "=E8+E9+E10+E11+E12"
  735. 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"
  736. xlSheet.Cells(15, 2) = "本期估驗 Nominal Tagihan" & vbCrLf & "(未稅Belum Termasuk Pajak)" : xlSheet.Cells(15, 3) = "' : "
  737. xlSheet.Cells(15, 4) = "=F13" : xlSheet.Cells(16, 2) = "PPN " & 稅金_nud.Value & "%" : xlSheet.Cells(16, 3) = "' : "
  738. xlSheet.Cells(16, 4) = 請款總額_nud.Value - 請款金額_nud.Value : xlSheet.Cells(17, 4) = "=D15+D16"
  739. xlSheet.Cells(18, 1) = "本期請款金額 Total Tagihan : Rp" : xlSheet.Cells(18, 3) = "' : " : xlSheet.Cells(18, 4) = "=D17"
  740. xlSheet.Cells(18, 7) = "元整" : xlSheet.Cells(18, 8) = "(含稅) Termasuk Ppn" : xlSheet.Cells(21, 2) = 客戶名稱_tb.Text : xlSheet.Cells(22, 2) = "驗收代表人"
  741. BB(xlApp, xlSheet)
  742. Else
  743. xlSheet.Cells(8, 1) = "1" : xlSheet.Cells(8, 2) = "Prepayments" & vbCrLf & "(預付款)" : xlSheet.Cells(8, 3) = 工程款1_nud.Value / 100
  744. If 請款期數_cb.Text = "一" Then : xlSheet.Cells(8, 5) = "=C8" : Else : xlSheet.Cells(8, 5) = "0" : End If
  745. xlSheet.Cells(9, 1) = "2" : xlSheet.Cells(9, 2) = "Material Cost Application" & vbCrLf & "(材料到貨款)" : xlSheet.Cells(9, 3) = 工程款2_nud.Value / 100
  746. If 請款期數_cb.Text = "二" Then : xlSheet.Cells(9, 5) = "=C9" : Else : xlSheet.Cells(9, 5) = "0" : End If
  747. xlSheet.Cells(10, 1) = "3" : xlSheet.Cells(10, 2) = "Installation Fee & Final Application" & vbCrLf & "(施工.驗收款)"
  748. xlSheet.Cells(10, 3) = 工程款4_nud.Value / 100 + 工程款3_nud.Value / 100
  749. If 請款期數_cb.Text = "三" Or 請款期數_cb.Text = "四" Then : xlSheet.Cells(10, 5) = "=C10" : Else : xlSheet.Cells(10, 5) = "0" : End If
  750. xlSheet.Cells(11, 1) = "4" : xlSheet.Cells(11, 2) = "Assure" & vbCrLf & "(保留款)" : xlSheet.Cells(11, 3) = 工程款5_nud.Value / 100
  751. If 請款期數_cb.Text = "五" Then : xlSheet.Cells(11, 5) = "=C11" : Else : xlSheet.Cells(11, 5) = "0" : End If
  752. For i As Integer = 8 To 11
  753. 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
  754. xlSheet.Cells(i, 6) = "=IF(E" & i & "=0,0,D" & i & ")" : If i = 8 Then : xlSheet.Cells(i, 7) = "=IF(E" & i & "=0,C" & i & ",0)"
  755. Else : xlSheet.Cells(i, 7) = "=IF(G" & i - 1 & "=0,0,IF(E" & i & "=0,C" & i & ",0))" : End If
  756. xlSheet.Cells(i, 8) = "=G" & i & "*$E$5"
  757. Next
  758. xlSheet.Cells(12, 1) = "Total" : xlSheet.Cells(12, 4) = "=D11+D10+D9+D8" : xlSheet.Cells(12, 5) = "=E8+E9+E10+E11"
  759. xlSheet.Cells(12, 6) = "=F8+F9+F10+F11" : xlSheet.Cells(12, 7) = "=G8+G9+G10+G11" : xlSheet.Cells(12, 8) = "=H8+H9+H10+H11"
  760. xlSheet.Cells(14, 2) = "本期估驗 Nominal Tagihan" & vbCrLf & "(未稅Belum Termasuk Pajak)" : xlSheet.Cells(14, 3) = "' : "
  761. xlSheet.Cells(14, 4) = "=F12" : xlSheet.Cells(16, 2) = "PPN " & 稅金_nud.Value & "%" : xlSheet.Cells(15, 3) = "' : "
  762. xlSheet.Cells(15, 4) = 請款總額_nud.Value - 請款金額_nud.Value : xlSheet.Cells(16, 4) = "=D14+D15"
  763. xlSheet.Cells(17, 1) = "本期請款金額 Total Tagihan : Rp" : xlSheet.Cells(17, 3) = "' : " : xlSheet.Cells(17, 4) = "=D16"
  764. xlSheet.Cells(17, 7) = "元整" : xlSheet.Cells(17, 8) = "(含稅) Termasuk Ppn" : xlSheet.Cells(20, 2) = 客戶名稱_tb.Text : xlSheet.Cells(21, 2) = "驗收代表人"
  765. BB2(xlApp, xlSheet)
  766. End If
  767. If Strings.Left(合約編號_tb.Text, 2) = "HX" Then : CC(xlApp, xlSheet) : Else : DD(xlApp, xlSheet) : End If : FF(xlApp, xlSheet)
  768. End If
  769. '----------------------------------------------------------------------------------------------------------------------
  770. If 主頁_ch.Checked = True Then
  771. xlSheet = NewMethod(xlBook) : xlApp.Sheets(1).Select : xlApp.Sheets(1).Name = "主頁"
  772. xlBook.Activate() : xlSheet.Activate()
  773. Dim BF As String
  774. If Strings.Left(合約編號_tb.Text, 2) = "HX" Then : BF = "PT HONG XHE INDUSTRIAL" & vbCrLf & "(鴻時工程有限公司)"
  775. Else : BF = "PT PUNCAK GEMILANG SEMESTA" & vbCrLf & "(鼎峰工程有限公司)" : End If
  776. Dim CF As String
  777. If 請款期數_cb.Text = "一" Then : CF = "第一次請款" & vbCrLf & "The First Installment of The Project Funds"
  778. ElseIf 請款期數_cb.Text = "二" Then : CF = "第二次請款" & vbCrLf & "The Second Installment of The Project Funds"
  779. ElseIf 請款期數_cb.Text = "三" Then : CF = "第三次請款" & vbCrLf & "The Third Installment of The Project Funds"
  780. ElseIf 請款期數_cb.Text = "四" Then : CF = "第四次請款" & vbCrLf & "The Fourth Installment of The Project Funds"
  781. ElseIf 請款期數_cb.Text = "五" Then : CF = "第五次請款" & vbCrLf & "The Fifth Installment of The Project Funds"
  782. End If
  783. xlSheet.Cells(2, 1) = "工程款撥付申請表"
  784. xlSheet.Cells(3, 1) = "Form Request Pembayaran Proyek Pembangunan"
  785. xlSheet.Cells(4, 1) = "客戶名稱 : " & vbCrLf & "Client's Name" : xlSheet.Cells(4, 2) = 客戶名稱_tb.Text
  786. xlSheet.Cells(5, 1) = "工程名稱:" & vbCrLf & "Nama Proyek" : xlSheet.Cells(5, 2) = 工程名稱_中_tb.Text & vbCrLf & 工程名稱_英_tb.Text
  787. xlSheet.Cells(6, 1) = "施工合同號:" & vbCrLf & "No. Kontrak Konstruksi" : xlSheet.Cells(6, 2) = 合約編號_tb.Text
  788. xlSheet.Cells(7, 1) = "施工單位:" & vbCrLf & "Perusahaan Konstruksi" : xlSheet.Cells(7, 2) = BF
  789. xlSheet.Cells(8, 1) = "付款專案:" & vbCrLf & "Proyek Pembayaran" : xlSheet.Cells(8, 2) = CF
  790. xlSheet.Cells(8, 5) = "合同總額 (未稅):" & vbCrLf & "Jumlah Total Kontrak"
  791. If 稅額顯示_lb.Text = "PPN 10%稅額 = Rp. " Then
  792. xlSheet.Cells(8, 6) = Strings.Format(ANUD2.Value / 1.1, "#,##0")
  793. Else
  794. xlSheet.Cells(8, 6) = Strings.Format(ANUD2.Value / 1.11, "#,##0")
  795. End If
  796. xlSheet.Cells(9, 1) = "請款單位:" & vbCrLf & "Departemen Pemohon" : xlSheet.Cells(9, 2) = BF
  797. xlSheet.Cells(9, 5) = "要求付款日期:" & vbCrLf & "Permintaan Tanggal Pembayaran" : xlSheet.Cells(9, 6) = 付款期限_cb.Text
  798. xlSheet.Cells(10, 1) = "本次請款金額 (未稅):" & vbCrLf & "Total Tagihan" : xlSheet.Cells(10, 2) = Strings.Format(請款金額_nud.Value, "#,##0")
  799. xlSheet.Cells(10, 5) = "累計已收金額 (未稅):" & vbCrLf & "Akumulasi Biaya yang Diterima"
  800. Dim 已請 As Long
  801. For I As Integer = 0 To 請款單_dgv.Rows.Count - 1
  802. If 請款期數_cb.Text = "一" Then
  803. 已請 = 0
  804. ElseIf 請款期數_cb.Text = "二" Then
  805. If 請款單_dgv.Rows(I).Cells("期數").Value.ToString = "一" Then
  806. 已請 = 已請 + 請款單_dgv.Rows(I).Cells("請款金額").Value
  807. End If
  808. ElseIf 請款期數_cb.Text = "三" Then
  809. If 請款單_dgv.Rows(I).Cells("期數").Value.ToString = "一" Or 請款單_dgv.Rows(I).Cells("期數").Value.ToString = "二" Then
  810. 已請 = 已請 + 請款單_dgv.Rows(I).Cells("請款金額").Value
  811. End If
  812. ElseIf 請款期數_cb.Text = "四" Then
  813. If 請款單_dgv.Rows(I).Cells("期數").Value.ToString = "一" Or 請款單_dgv.Rows(I).Cells("期數").Value.ToString = "二" Or
  814. 請款單_dgv.Rows(I).Cells("期數").Value.ToString = "三" Then
  815. 已請 = 已請 + 請款單_dgv.Rows(I).Cells("請款金額").Value
  816. End If
  817. ElseIf 請款期數_cb.Text = "五" Then
  818. If 請款單_dgv.Rows(I).Cells("期數").Value.ToString = "一" Or 請款單_dgv.Rows(I).Cells("期數").Value.ToString = "二" Or
  819. 請款單_dgv.Rows(I).Cells("期數").Value.ToString = "三" Or 請款單_dgv.Rows(I).Cells("期數").Value.ToString = "四" Then
  820. 已請 = 已請 + 請款單_dgv.Rows(I).Cells("請款金額").Value
  821. End If
  822. End If
  823. Next
  824. xlSheet.Cells(10, 6) = Strings.Format(已請, "#,##0")
  825. xlSheet.Cells(11, 1) = "本次請款內容:" & vbCrLf & "Deskripsi Tagihan" : xlSheet.Cells(11, 2) = 請款內容_tb.Text
  826. If 主頁明細_ch.Checked = True Then
  827. xlSheet.Cells(14, 2) = "合約金額(Contract Amount) : "
  828. If 稅額顯示_lb.Text = "PPN 10%稅額 = Rp. " Then
  829. xlSheet.Cells(14, 4) = Strings.Format(ANUD1.Value / 1.1, "#,##0")
  830. Else
  831. xlSheet.Cells(14, 4) = Strings.Format(ANUD1.Value / 1.11, "#,##0")
  832. End If : xlSheet.Cells(14, 5) = " RP (未稅)"
  833. xlSheet.Cells(15, 2) = "結算金額(Settlement Amount) : "
  834. If 稅額顯示_lb.Text = "PPN 10%稅額 = Rp. " Then
  835. xlSheet.Cells(15, 4) = Strings.Format(ANUD2.Value / 1.1, "#,##0")
  836. Else
  837. xlSheet.Cells(15, 4) = Strings.Format(ANUD2.Value / 1.11, "#,##0")
  838. End If : xlSheet.Cells(15, 5) = " RP (未稅)"
  839. xlSheet.Cells(16, 2) = "實際追加減(Add To) : "
  840. If 稅額顯示_lb.Text = "PPN 10%稅額 = Rp. " Then
  841. xlSheet.Cells(16, 4) = Strings.Format(ANUD3.Value / 1.1, "#,##0")
  842. Else
  843. xlSheet.Cells(16, 4) = Strings.Format(ANUD3.Value / 1.11, "#,##0")
  844. End If : xlSheet.Cells(16, 5) = " RP (未稅)"
  845. xlSheet.Cells(17, 2) = "已請款(Requested) : " : xlSheet.Cells(17, 4) = Strings.Format(已請, "#,##0") : xlSheet.Cells(17, 5) = " RP (未稅)"
  846. xlSheet.Cells(18, 2) = "剩餘款(Remaining) : " : xlSheet.Cells(18, 4) = "=D15-D17" : xlSheet.Cells(18, 5) = " RP (未稅)"
  847. xlSheet.Cells(19, 2) = "其中:"
  848. If 請款期數_cb.Text = "四" Then : xlSheet.Cells(20, 2) = "驗收款(Final acceptance) : " : Else : xlSheet.Cells(20, 2) = "未收款(Unpaid) : " : End If
  849. xlSheet.Cells(20, 4) = "=D15-D17-D21" : xlSheet.Cells(20, 5) = " RP (未稅)"
  850. xlSheet.Cells(21, 2) = "保留款(Assure) : " : xlSheet.Cells(21, 4) = "= D15 * " & 工程款5_nud.Value & "/ 100" : xlSheet.Cells(21, 5) = " RP (未稅)"
  851. End If
  852. xlSheet.Cells(23, 3) = "申請人 Pemohon:" : xlSheet.Cells(23, 4) = BF
  853. xlSheet.Cells(25, 3) = "申請時間 Waktu:" : xlSheet.Cells(25, 4) = Strings.Format(申請日期_dtp.Value, "yyyy/MM/dd")
  854. xlSheet.Cells(26, 1) = "籌建辦審批意見:" & vbCrLf & "Komentar Penyetuju Kantor Konstruksi Umum" : xlSheet.Cells(26, 2) = 其他意見_tb.Text
  855. xlSheet.Cells(36, 3) = "審核人 Disetujui oleh:" : xlSheet.Cells(37, 3) = "審核時間 Waktu:"
  856. xlSheet.Cells(39, 1) = "本表一式三份:施工單位、籌建辦、財務單位各一份。"
  857. xlSheet.Cells(40, 1) = "Form ini dirangkap 3 lembar: Perusahaan konstruksi, kantor konstruksi umum, departemen finance"
  858. AA(xlApp, xlSheet)
  859. If 甲方_tb.Text = "JCS" Then : JCS(xlApp, xlSheet) : ElseIf 甲方_tb.Text = "J2" Then : J2(xlApp, xlSheet) : Else
  860. If Strings.Left(合約編號_tb.Text, 2) = "HX" Then : CC(xlApp, xlSheet) : Else : DD(xlApp, xlSheet) : End If : FF(xlApp, xlSheet)
  861. End If
  862. End If
  863. If 報告移交單_ch.Checked = True And 請款單_ch.Checked = True And 主頁_ch.Checked = True Then : xlApp.Sheets(4).Delete
  864. ElseIf 報告移交單_ch.Checked = True And 請款單_ch.Checked = True And 主頁_ch.Checked = False Then : xlApp.Sheets(3).Delete
  865. ElseIf 報告移交單_ch.Checked = True And 請款單_ch.Checked = False And 主頁_ch.Checked = True Then : xlApp.Sheets(3).Delete
  866. ElseIf 報告移交單_ch.Checked = False And 請款單_ch.Checked = True And 主頁_ch.Checked = True Then : xlApp.Sheets(3).Delete
  867. ElseIf 報告移交單_ch.Checked = True And 請款單_ch.Checked = False And 主頁_ch.Checked = False Then : xlApp.Sheets(2).Delete
  868. ElseIf 報告移交單_ch.Checked = False And 請款單_ch.Checked = True And 主頁_ch.Checked = False Then : xlApp.Sheets(2).Delete
  869. ElseIf 報告移交單_ch.Checked = False And 請款單_ch.Checked = False And 主頁_ch.Checked = True Then : xlApp.Sheets(2).Delete
  870. End If
  871. xlSheet.PageSetup.PrintArea = ""
  872. xlApp.Cells.Select()
  873. xlApp.Application.WindowState = xlMinimized
  874. If 系統語言 = "繁體中文" Then : MsgBox("列印完成!!") : Else : MsgBox("cetak selesai!!") : End If
  875. Catch ex As Exception
  876. MsgBox(ex.Message)
  877. End Try
  878. End If
  879. End If
  880. End If
  881. End If
  882. End If
  883. End Sub
  884. Private Shared Function NewMethod(xlBook As Workbook) As Worksheet
  885. Return CType(xlBook.Worksheets.Add, Worksheet)
  886. End Function
  887. Private Sub AA(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  888. xlSheet.Cells.Select()
  889. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 10 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  890. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  891. xlSheet.Rows("1:1").Select : myExcel.Selection.RowHeight = 95
  892. xlSheet.Rows("2:3").Select
  893. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 18 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  894. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  895. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 30 : xlSheet.Columns("B:D").Select : myExcel.Selection.ColumnWidth = 15
  896. xlSheet.Columns("E:E").Select : myExcel.Selection.ColumnWidth = 30 : xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 15
  897. xlSheet.Rows("4:7").Select : myExcel.Selection.RowHeight = 40
  898. xlSheet.Range("B4:F4").Select()
  899. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  900. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  901. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  902. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  903. xlSheet.Range("B5:F5").Select() : With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False
  904. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  905. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  906. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  907. xlSheet.Range("B6:F6").Select()
  908. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  909. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  910. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  911. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  912. xlSheet.Range("B7:F7").Select()
  913. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  914. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  915. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  916. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  917. xlSheet.Range("A2:F2").Select()
  918. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  919. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  920. xlSheet.Range("A3:F3").Select()
  921. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  922. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  923. xlSheet.Rows("8:10").Select : myExcel.Selection.RowHeight = 40
  924. xlSheet.Range("B8:D8").Select()
  925. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  926. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  927. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  928. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  929. xlSheet.Range("B9:D9").Select()
  930. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  931. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  932. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  933. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  934. xlSheet.Range("B10:D10").Select()
  935. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  936. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  937. xlSheet.Range("F8:F10").Select()
  938. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  939. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  940. xlSheet.Range("B11:F12").Select()
  941. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  942. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  943. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False
  944. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  945. xlSheet.Range("A11:A25").Select()
  946. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  947. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  948. xlSheet.Range("D24:F24").Select()
  949. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  950. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  951. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  952. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  953. xlSheet.Rows("24:24").Select : myExcel.Selection.RowHeight = 13.5
  954. xlSheet.Range("C24").Select()
  955. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  956. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  957. xlSheet.Range("C25").Select()
  958. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  959. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  960. xlSheet.Range("D25").Select()
  961. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  962. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  963. xlSheet.Rows("26:26").Select : myExcel.Selection.RowHeight = 13.5
  964. xlSheet.Range("A26:A37").Select()
  965. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  966. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  967. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = True : .Orientation = 0 : .AddIndent = False
  968. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  969. xlSheet.Range("A11:A25").Select()
  970. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = True : .Orientation = 0 : .AddIndent = False
  971. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  972. xlSheet.Range("B26:F35").Select()
  973. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  974. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  975. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = True : .Orientation = 0 : .AddIndent = False
  976. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  977. xlSheet.Range("C36").Select()
  978. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  979. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  980. xlSheet.Range("C37").Select()
  981. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  982. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  983. xlSheet.Range("A4:F10").Select()
  984. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  985. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  986. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  987. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  988. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  989. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  990. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  991. xlSheet.Range("B11:F25").Select()
  992. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  993. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  994. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  995. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  996. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  997. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  998. xlSheet.Range("A11:A25").Select()
  999. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1000. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1001. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1002. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1003. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1004. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1005. xlSheet.Range("A26:A37").Select()
  1006. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1007. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1008. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1009. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1010. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1011. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1012. xlSheet.Range("B26:F37").Select()
  1013. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1014. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1015. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1016. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1017. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1018. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1019. xlSheet.Range("A4:F37").Select()
  1020. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1021. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1022. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1023. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1024. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1025. xlSheet.Range("A38:F41").Select()
  1026. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1027. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1028. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1029. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1030. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1031. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1032. myExcel.ActiveWindow.DisplayGridlines = False
  1033. xlSheet.Range("D23:F24").Select()
  1034. With myExcel.Selection : .HorizontalAlignment = xlGeneral : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1035. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.UnMerge
  1036. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1037. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1038. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1039. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1040. xlSheet.Range("D21").Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1041. xlSheet.Range("I6").Select()
  1042. End Sub
  1043. Private Sub BB(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1044. xlSheet.Cells.Select()
  1045. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 10 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1046. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1047. xlSheet.Range("D15:F18").Select()
  1048. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 14 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1049. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1050. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 5 : xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 40
  1051. xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 17
  1052. xlSheet.Columns("E:E").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 17
  1053. xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("H:H").Select : myExcel.Selection.ColumnWidth = 17
  1054. xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 10
  1055. xlSheet.Rows("1:1").Select : myExcel.Selection.RowHeight = 95 : xlSheet.Rows("3:3").Select : myExcel.Selection.RowHeight = 30
  1056. xlSheet.Rows("4:4").Select : myExcel.Selection.RowHeight = 50 : xlSheet.Rows("5:5").Select : myExcel.Selection.RowHeight = 25
  1057. xlSheet.Rows("7:7").Select : myExcel.Selection.RowHeight = 40 : xlSheet.Rows("8:12").Select : myExcel.Selection.RowHeight = 30
  1058. xlSheet.Rows("13:13").Select : myExcel.Selection.RowHeight = 30 : xlSheet.Rows("14:21").Select : myExcel.Selection.RowHeight = 30
  1059. xlSheet.Rows("23:23").Select : myExcel.Selection.RowHeight = 120
  1060. xlSheet.Range("A2:I2").Select()
  1061. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1062. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1063. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 22 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1064. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1065. myExcel.Selection.Font.Underline = xlUnderlineStyleSingle
  1066. xlSheet.Range("A3:G3").Select()
  1067. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1068. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1069. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1070. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1071. xlSheet.Range("H3:I3").Select()
  1072. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1073. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1074. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1075. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1076. xlSheet.Range("A4:G4").Select()
  1077. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1078. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1079. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1080. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1081. With myExcel.Selection : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  1082. .ReadingOrder = xlContext : End With
  1083. xlSheet.Range("H4:I4").Select()
  1084. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1085. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1086. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1087. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1088. xlSheet.Range("A5:D5").Select()
  1089. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1090. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1091. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1092. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1093. xlSheet.Range("E5:I5").Select()
  1094. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1095. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1096. myExcel.Selection.NumberFormatLocal = "#,##0"
  1097. xlSheet.Range("E7:F7").Select()
  1098. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1099. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1100. xlSheet.Range("G7:H7").Select()
  1101. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1102. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1103. xlSheet.Range("A7:I7").Select()
  1104. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1105. .ShrinkToFit = False : .ReadingOrder = xlContext : End With
  1106. xlSheet.Range("A8:A12").Select()
  1107. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1108. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1109. xlSheet.Range("A8:B12").Select()
  1110. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1111. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1112. xlSheet.Range("C8:C12").Select() : myExcel.Selection.Style = "Percent"
  1113. xlSheet.Range("E8:E13").Select() : myExcel.Selection.Style = "Percent"
  1114. xlSheet.Range("G8:G13").Select() : myExcel.Selection.Style = "Percent"
  1115. xlSheet.Range("D8:D18").Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1116. xlSheet.Range("F8:F13").Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1117. xlSheet.Range("H8:H13").Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1118. xlSheet.Range("A13:C13").Select()
  1119. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1120. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1121. xlSheet.Range("B15:B16").Select()
  1122. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1123. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1124. xlSheet.Range("D15:E15").Select()
  1125. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1126. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1127. xlSheet.Range("D16:E16").Select()
  1128. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1129. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1130. xlSheet.Range("D17:E17").Select()
  1131. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1132. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1133. xlSheet.Range("D18:F18").Select()
  1134. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1135. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1136. xlSheet.Range("B21:D21").Select()
  1137. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1138. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1139. xlSheet.Range("B22:D22").Select()
  1140. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1141. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1142. xlSheet.Range("A3:I4").Select()
  1143. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1144. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1145. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1146. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1147. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1148. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1149. xlSheet.Range("A5:I5").Select()
  1150. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1151. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1152. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1153. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1154. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1155. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1156. xlSheet.Range("A7:I7").Select()
  1157. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1158. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1159. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1160. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1161. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1162. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1163. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1164. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1165. xlSheet.Range("A8:I12").Select()
  1166. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1167. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1168. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1169. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1170. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1171. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1172. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1173. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1174. xlSheet.Range("A13:I13").Select()
  1175. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1176. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1177. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1178. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1179. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1180. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1181. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1182. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1183. xlSheet.Range("B16:E16").Select()
  1184. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1185. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1186. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1187. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1188. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1189. xlSheet.Range("D18:F18").Select()
  1190. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1191. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1192. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1193. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1194. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1195. xlSheet.Range("A14:I23").Select()
  1196. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1197. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1198. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1199. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1200. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1201. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1202. xlSheet.Range("J16").Select() : myExcel.ActiveWindow.DisplayGridlines = False
  1203. xlSheet.Range("C7:D12").Select() : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent6 : .TintAndShade = 0 : End With
  1204. xlSheet.Range("D13").Select() : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent6 : .TintAndShade = 0 : End With
  1205. xlSheet.Range("E7:F13").Select() : With myExcel.Selection.Font : .Color = -16776961 : .TintAndShade = 0 : End With
  1206. xlSheet.Range("G7:H13").Select() : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent1 : .TintAndShade = 0 : End With
  1207. xlSheet.Range("A7:I13").Select() : myExcel.Selection.Font.Bold = True
  1208. End Sub
  1209. Private Sub BB2(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1210. xlSheet.Cells.Select()
  1211. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 10 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1212. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1213. xlSheet.Range("D14:F17").Select()
  1214. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 14 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1215. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1216. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 5 : xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 40
  1217. xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 17
  1218. xlSheet.Columns("E:E").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 17
  1219. xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("H:H").Select : myExcel.Selection.ColumnWidth = 17
  1220. xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 10
  1221. xlSheet.Rows("1:1").Select : myExcel.Selection.RowHeight = 95 : xlSheet.Rows("3:3").Select : myExcel.Selection.RowHeight = 30
  1222. xlSheet.Rows("4:4").Select : myExcel.Selection.RowHeight = 50 : xlSheet.Rows("5:5").Select : myExcel.Selection.RowHeight = 25
  1223. xlSheet.Rows("7:7").Select : myExcel.Selection.RowHeight = 40 : xlSheet.Rows("8:11").Select : myExcel.Selection.RowHeight = 30
  1224. xlSheet.Rows("12:12").Select : myExcel.Selection.RowHeight = 30 : xlSheet.Rows("13:20").Select : myExcel.Selection.RowHeight = 30
  1225. xlSheet.Rows("22:22").Select : myExcel.Selection.RowHeight = 120
  1226. xlSheet.Range("A2:I2").Select()
  1227. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1228. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1229. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 22 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1230. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1231. myExcel.Selection.Font.Underline = xlUnderlineStyleSingle
  1232. xlSheet.Range("A3:G3").Select()
  1233. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1234. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1235. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1236. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1237. xlSheet.Range("H3:I3").Select()
  1238. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1239. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1240. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1241. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1242. xlSheet.Range("A4:G4").Select()
  1243. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1244. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1245. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1246. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1247. With myExcel.Selection : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  1248. .ReadingOrder = xlContext : End With
  1249. xlSheet.Range("H4:I4").Select()
  1250. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1251. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1252. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1253. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1254. xlSheet.Range("A5:D5").Select()
  1255. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1256. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1257. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1258. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1259. xlSheet.Range("E5:I5").Select()
  1260. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1261. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1262. myExcel.Selection.NumberFormatLocal = "#,##0"
  1263. xlSheet.Range("E7:F7").Select()
  1264. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1265. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1266. xlSheet.Range("G7:H7").Select()
  1267. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1268. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1269. xlSheet.Range("A7:I7").Select()
  1270. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1271. .ShrinkToFit = False : .ReadingOrder = xlContext : End With
  1272. xlSheet.Range("A8:A11").Select()
  1273. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1274. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1275. xlSheet.Range("A8:B11").Select()
  1276. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1277. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1278. xlSheet.Range("C8:C11").Select() : myExcel.Selection.Style = "Percent"
  1279. xlSheet.Range("E8:E12").Select() : myExcel.Selection.Style = "Percent"
  1280. xlSheet.Range("G8:G12").Select() : myExcel.Selection.Style = "Percent"
  1281. xlSheet.Range("D8:D17").Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1282. xlSheet.Range("F8:F12").Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1283. xlSheet.Range("H8:H12").Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  1284. xlSheet.Range("A12:C12").Select()
  1285. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1286. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1287. xlSheet.Range("B14:B15").Select()
  1288. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1289. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1290. xlSheet.Range("D14:E14").Select()
  1291. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1292. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1293. xlSheet.Range("D15:E15").Select()
  1294. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1295. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1296. xlSheet.Range("D16:E16").Select()
  1297. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1298. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1299. xlSheet.Range("D17:F17").Select()
  1300. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1301. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1302. xlSheet.Range("B20:D20").Select()
  1303. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1304. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1305. xlSheet.Range("B21:D21").Select()
  1306. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1307. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1308. xlSheet.Range("A3:I4").Select()
  1309. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1310. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1311. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1312. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1313. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1314. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1315. xlSheet.Range("A5:I5").Select()
  1316. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1317. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1318. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1319. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1320. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1321. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1322. xlSheet.Range("A7:I7").Select()
  1323. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1324. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1325. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1326. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1327. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1328. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1329. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1330. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1331. xlSheet.Range("A8:I11").Select()
  1332. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1333. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1334. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1335. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1336. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1337. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1338. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1339. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1340. xlSheet.Range("A12:I12").Select()
  1341. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1342. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1343. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1344. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1345. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1346. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1347. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1348. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1349. xlSheet.Range("B15:E15").Select()
  1350. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1351. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1352. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1353. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1354. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1355. xlSheet.Range("D17:F17").Select()
  1356. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1357. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1358. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1359. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1360. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1361. xlSheet.Range("A13:I22").Select()
  1362. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1363. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1364. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1365. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1366. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1367. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1368. xlSheet.Range("J16").Select() : myExcel.ActiveWindow.DisplayGridlines = False
  1369. xlSheet.Range("C7:D11").Select() : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent6 : .TintAndShade = 0 : End With
  1370. xlSheet.Range("D12").Select() : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent6 : .TintAndShade = 0 : End With
  1371. xlSheet.Range("E7:F12").Select() : With myExcel.Selection.Font : .Color = -16776961 : .TintAndShade = 0 : End With
  1372. xlSheet.Range("G7:H12").Select() : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent1 : .TintAndShade = 0 : End With
  1373. xlSheet.Range("A7:I12").Select() : myExcel.Selection.Font.Bold = True
  1374. End Sub
  1375. Private Sub AB(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1376. Dim 位置 As String
  1377. xlSheet.Cells.Select()
  1378. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1379. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1380. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 5 : xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 30
  1381. xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 3 : xlSheet.Columns("D:E").Select : myExcel.Selection.ColumnWidth = 40
  1382. xlSheet.Rows("1:1").Select : myExcel.Selection.RowHeight = 95
  1383. xlSheet.Range("A2:E2").Select()
  1384. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1385. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1386. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 18 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1387. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1388. myExcel.Selection.Font.Underline = xlUnderlineStyleSingle
  1389. xlSheet.Range("A4:E4").Select()
  1390. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1391. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1392. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1393. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1394. xlSheet.Range("A6:B6").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 : myExcel.Selection.Merge
  1397. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1398. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1399. xlSheet.Range("C6:E6").Select()
  1400. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1401. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1402. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1403. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1404. xlSheet.Range("A7:B7").Select()
  1405. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1406. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1407. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1408. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1409. xlSheet.Rows("7:7").Select : myExcel.Selection.RowHeight = 30
  1410. xlSheet.Range("C7:E7").Select()
  1411. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1412. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1413. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1414. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1415. xlSheet.Range("A9:E9").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. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1419. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1420. xlSheet.Range("A6:B7").Select()
  1421. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1422. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : End With
  1423. xlSheet.Range("A11:B11").Select()
  1424. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1425. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1426. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1427. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1428. xlSheet.Range("A12:B12").Select()
  1429. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1430. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1431. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1432. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1433. xlSheet.Range("C11:E11").Select()
  1434. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1435. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1436. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1437. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1438. xlSheet.Rows("12:12").Select : myExcel.Selection.RowHeight = 30
  1439. xlSheet.Range("C12:E12").Select()
  1440. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1441. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1442. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1443. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1444. xlSheet.Range("A14:E14").Select()
  1445. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1446. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1447. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1448. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1449. If 請款期數_cb.Text = "四" Then : 位置 = "D16:D21" : Else : 位置 = "D16:D20" : End If : xlSheet.Range(位置).Select()
  1450. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1451. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1452. If 請款期數_cb.Text = "四" Then : 位置 = "C16:C21" : Else : 位置 = "C16:C20" : End If : xlSheet.Range(位置).Select()
  1453. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1454. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1455. If 請款期數_cb.Text = "四" Then
  1456. xlSheet.Rows("23:23").Select : myExcel.Selection.RowHeight = 30
  1457. xlSheet.Range("A23:E23").Select()
  1458. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1459. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1460. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1461. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1462. Else : End If
  1463. If 請款期數_cb.Text = "四" Then
  1464. xlSheet.Rows("24:24").Select : myExcel.Selection.RowHeight = 30 : 位置 = "A24:E24" : xlSheet.Range(位置).Select()
  1465. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1466. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1467. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1468. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1469. Else
  1470. xlSheet.Rows("22:22").Select : myExcel.Selection.RowHeight = 30 : 位置 = "A22:E22" : xlSheet.Range(位置).Select()
  1471. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1472. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1473. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1474. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1475. End If
  1476. If 請款期數_cb.Text = "四" Then : 位置 = "A25:E25" : Else : 位置 = "A23:E23" : End If : xlSheet.Range(位置).Select()
  1477. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1478. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1479. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1480. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1481. If 請款期數_cb.Text = "四" Then : xlSheet.Range("D27").Select() : Else : xlSheet.Range("D25").Select() : End If
  1482. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1483. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1484. If 請款期數_cb.Text = "四" Then : xlSheet.Range("E27").Select() : Else : xlSheet.Range("E25").Select() : End If
  1485. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1486. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1487. If 請款期數_cb.Text = "四" Then : xlSheet.Range("E29:E31").Select() : Else : xlSheet.Range("E27:E29").Select() : End If
  1488. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1489. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1490. If 請款期數_cb.Text = "四" Then : xlSheet.Range("B31:D31").Select() : Else : xlSheet.Range("B29:D29").Select() : End If
  1491. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1492. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1493. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1494. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1495. If 請款期數_cb.Text = "四" Then : xlSheet.Range("B30").Select() : Else : xlSheet.Range("B28").Select() : End If
  1496. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1497. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1498. If 請款期數_cb.Text = "四" Then : xlSheet.Rows("32:32").Select : Else : xlSheet.Rows("30:30").Select : End If : myExcel.Selection.RowHeight = 100
  1499. myExcel.ActiveWindow.DisplayGridlines = False
  1500. End Sub
  1501. Private Sub CC(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1502. Clipboard.SetDataObject(PictureBox1.Image)
  1503. xlSheet.Range("A1").Select()
  1504. myExcel.ActiveSheet.Pictures.Paste.Select
  1505. myExcel.Selection.ShapeRange.Height = 93
  1506. myExcel.Selection.ShapeRange.IncrementLeft(0)
  1507. myExcel.Selection.ShapeRange.IncrementTop(0)
  1508. End Sub
  1509. Private Sub DD(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1510. Clipboard.SetDataObject(PictureBox2.Image)
  1511. xlSheet.Range("A1").Select()
  1512. myExcel.ActiveSheet.Pictures.Paste.Select
  1513. myExcel.Selection.ShapeRange.Height = 93
  1514. myExcel.Selection.ShapeRange.IncrementLeft(0)
  1515. myExcel.Selection.ShapeRange.IncrementTop(0)
  1516. End Sub
  1517. Private Sub JCS(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1518. Clipboard.SetDataObject(JCS_PB.Image)
  1519. xlSheet.Range("A1").Select()
  1520. myExcel.ActiveSheet.Pictures.Paste.Select
  1521. myExcel.Selection.ShapeRange.Height = 93
  1522. myExcel.Selection.ShapeRange.IncrementLeft(0)
  1523. myExcel.Selection.ShapeRange.IncrementTop(0)
  1524. End Sub
  1525. Private Sub J2(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1526. Clipboard.SetDataObject(J2_PB.Image)
  1527. xlSheet.Range("A1").Select()
  1528. myExcel.ActiveSheet.Pictures.Paste.Select
  1529. myExcel.Selection.ShapeRange.Height = 93
  1530. myExcel.Selection.ShapeRange.IncrementLeft(0)
  1531. myExcel.Selection.ShapeRange.IncrementTop(0)
  1532. End Sub
  1533. Private Sub FF(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1534. myExcel.Application.PrintCommunication = False : With myExcel.ActiveSheet.PageSetup : .PrintTitleRows = "" : .PrintTitleColumns = "" : End With
  1535. myExcel.Application.PrintCommunication = True : myExcel.ActiveSheet.PageSetup.PrintArea = "" : myExcel.Application.PrintCommunication = False
  1536. With myExcel.ActiveSheet.PageSetup : .LeftHeader = "" : .CenterHeader = "" : .RightHeader = "" : .LeftFooter = "" : .CenterFooter = "第 &P 頁,共 &N 頁" : .RightFooter = ""
  1537. .LeftMargin = myExcel.Application.InchesToPoints(0.236220472440945) : .RightMargin = myExcel.Application.InchesToPoints(0.236220472440945)
  1538. .TopMargin = myExcel.Application.InchesToPoints(0.748031496062992) : .BottomMargin = myExcel.Application.InchesToPoints(0.748031496062992)
  1539. .HeaderMargin = myExcel.Application.InchesToPoints(0.31496062992126) : .FooterMargin = myExcel.Application.InchesToPoints(0.31496062992126)
  1540. .PrintHeadings = False : .PrintGridlines = False : .CenterHorizontally = True : .CenterVertically = False : .Draft = False
  1541. .FirstPageNumber = xlAutomatic : .BlackAndWhite = False : .Zoom = False : .FitToPagesWide = 1 : .FitToPagesTall = False : .OddAndEvenPagesHeaderFooter = False
  1542. .DifferentFirstPageHeaderFooter = False : .ScaleWithDocHeaderFooter = True : .AlignMarginsHeaderFooter = True
  1543. .EvenPage.LeftHeader.Text = "" : .EvenPage.CenterHeader.Text = "" : .EvenPage.RightHeader.Text = "" : .EvenPage.LeftFooter.Text = ""
  1544. .EvenPage.CenterFooter.Text = "" : .EvenPage.RightFooter.Text = "" : .FirstPage.LeftHeader.Text = "" : .FirstPage.CenterHeader.Text = ""
  1545. .FirstPage.RightHeader.Text = "" : .FirstPage.LeftFooter.Text = "" : .FirstPage.CenterFooter.Text = "" : .FirstPage.RightFooter.Text = ""
  1546. End With : myExcel.Application.PrintCommunication = True
  1547. End Sub
  1548. End Class