暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

財物支付單申請_傳票.vb 181KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810
  1. Option Strict Off
  2. Imports System.IO
  3. Imports Microsoft.Office.Interop.Excel.XlUnderlineStyle
  4. Imports Microsoft.Office.Interop.Excel.Constants
  5. Imports Microsoft.Office.Interop.Excel.XlBordersIndex
  6. Imports Microsoft.Office.Interop.Excel.XlLineStyle
  7. Imports Microsoft.Office.Interop.Excel.XlBorderWeight
  8. Imports Microsoft.Office.Interop.Excel.XlThemeFont
  9. Imports Microsoft.Office.Interop.Excel.XlThemeColor
  10. Imports Microsoft.Office.Interop.Excel.XlWindowState
  11. Imports Microsoft.Office.Interop.Excel
  12. Public Class 財物支付單申請_傳票
  13. Dim SK1, SK2 As String : Dim 不可編輯x, 已開啟 As Boolean
  14. Dim 新項次 As String : Dim 新流水1 As String : Dim 新流水2 As String
  15. Dim NUM1 As Integer : Dim 匯率1 As Double : Dim 對話框(20) As String
  16. Dim xlApp As Application
  17. Dim xlBook As Workbook
  18. Dim xlSheet As Worksheet
  19. Private Sub 語言轉換讀取()
  20. If 系統語言 = "繁體中文" Then : 語言 = "CH" : ElseIf 系統語言 = "English" Then : 語言 = "EN" : ElseIf 系統語言 = "Indonesian" Then : 語言 = "IN" : End If
  21. If 跨部門開啟 = False Then : Me.Text = 系統語言字典("H001-112-" & 語言) : Else : Me.Text = 系統語言字典("H001-113-" & 語言) : End If
  22. 財務單號_lb.Text = 系統語言字典("H301-129-" & 語言) : Label1.Text = 系統語言字典("H314-100-" & 語言) : Label2.Text = 系統語言字典("H314-101-" & 語言)
  23. Label3.Text = 系統語言字典("H314-102-" & 語言) : Label4.Text = 系統語言字典("H314-103-" & 語言) : Label5.Text = 系統語言字典("H314-104-" & 語言)
  24. Label6.Text = 系統語言字典("H314-105-" & 語言) : 會計科目_lb.Text = 系統語言字典("H301-120-" & 語言) : 表頭(113) = 系統語言字典("H204-120-" & 語言)
  25. 表頭(112) = 系統語言字典("H301-107-" & 語言) : 表頭(39) = 系統語言字典("H301-134-" & 語言) : 表頭(111) = 系統語言字典("H301-108-" & 語言)
  26. 表頭(20) = 系統語言字典("H314-124-" & 語言) : 表頭(107) = 系統語言字典("H301-111-" & 語言) : 表頭(109) = 系統語言字典("H301-109-" & 語言)
  27. 表頭(11) = 系統語言字典("H301-112-" & 語言) : 表頭(114) = 系統語言字典("H301-113-" & 語言) : 表頭(98) = 系統語言字典("H301-114-" & 語言)
  28. 表頭(115) = 系統語言字典("H301-116-" & 語言) : 表頭(108) = 系統語言字典("H301-117-" & 語言) : 表頭(110) = 系統語言字典("H301-115-" & 語言)
  29. Label8.Text = 系統語言字典("H314-106-" & 語言) : Label9.Text = 系統語言字典("H314-107-" & 語言) : Label10.Text = 系統語言字典("H314-108-" & 語言)
  30. Label11.Text = 系統語言字典("H314-109-" & 語言) : Label12.Text = 系統語言字典("H314-110-" & 語言) : 對話框(2) = 系統語言字典("H301-125-" & 語言)
  31. 對話框(3) = 系統語言字典("G000-117-" & 語言) : 對話框(1) = 系統語言字典("H301-124-" & 語言) : 表頭(1) = 系統語言字典("H314-106-" & 語言)
  32. 對話框(4) = 系統語言字典("H301-127-" & 語言) : 對話框(5) = 系統語言字典("H302-119-" & 語言) : 對話框(6) = 系統語言字典("H302-120-" & 語言)
  33. 對話框(7) = 系統語言字典("H302-121-" & 語言) : 表頭(2) = 系統語言字典("H507-121-" & 語言) : 表頭(3) = 系統語言字典("H314-111-" & 語言)
  34. 對話框(8) = 系統語言字典("H314-112-" & 語言) : Label18.Text = 系統語言字典("H314-113-" & 語言) : Label15.Text = 系統語言字典("H314-114-" & 語言)
  35. Label17.Text = 系統語言字典("H314-115-" & 語言) : Label16.Text = 系統語言字典("H314-116-" & 語言) : Label19.Text = 系統語言字典("H301-140-" & 語言)
  36. 對話框(9) = 系統語言字典("H314-123-" & 語言) : Label20.Text = 系統語言字典("H314-124-" & 語言) : 對話框(10) = 系統語言字典("H303-129-" & 語言)
  37. 對話框(11) = 系統語言字典("H303-102-" & 語言) : 對話框(12) = 系統語言字典("H303-101-" & 語言) : 對話框(13) = 系統語言字典("H611-112-" & 語言)
  38. 對話框(14) = 系統語言字典("H611-111-" & 語言) : 對話框(15) = 系統語言字典("H611-113-" & 語言) : 對話框(16) = 系統語言字典("H405-105-" & 語言)
  39. 對話框(17) = 系統語言字典("H405-104-" & 語言) : 對話框(18) = 系統語言字典("H405-106-" & 語言) : Label21.Text = 系統語言字典("H303-108-" & 語言)
  40. 月_ch.Text = 系統語言字典("H306-106-" & 語言) : 週_ch.Text = 系統語言字典("H303-139-" & 語言) : 日_ch.Text = 系統語言字典("H303-140-" & 語言)
  41. 解開星期五_ch.Text = 系統語言字典("H314-129-" & 語言)
  42. 修改BT()
  43. End Sub
  44. Private Sub 修改BT()
  45. If 月_ch.Checked Then
  46. 當月_bt.Text = 對話框(10) : 上個月_bt.Text = 對話框(11) : 下個月_bt.Text = 對話框(12)
  47. ElseIf 週_ch.Checked Then
  48. 當月_bt.Text = 對話框(13) : 上個月_bt.Text = 對話框(14) : 下個月_bt.Text = 對話框(15)
  49. Else
  50. 當月_bt.Text = 對話框(16) : 上個月_bt.Text = 對話框(17) : 下個月_bt.Text = 對話框(18)
  51. End If
  52. End Sub
  53. Private Sub 載入支付對象()
  54. Dim ds1 As New DataSet : 支付對象1_dgv.DataSource = Nothing : ds1.Clear()
  55. 支付對象1_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  56. 支付對象1_dgv.ColumnHeadersHeight = 40 : 支付對象1_dgv.AllowUserToAddRows = False
  57. If 公司類別_cb.Text = "PT" Then : SQL2 = " AND 公司名 LIKE N'PT%'"
  58. ElseIf 公司類別_cb.Text = "CV" Then : SQL2 = " AND 公司名 LIKE N'CV%'"
  59. ElseIf 公司類別_cb.Text = "UD" Then : SQL2 = " AND 公司名 LIKE N'UD%'"
  60. ElseIf 公司類別_cb.Text = "NA" Or 公司類別_cb.Text = "" Then : SQL2 = " AND 公司名 NOT LIKE N'CV%' AND 公司名 NOT LIKE N'PT%' AND 公司名 NOT LIKE N'UD%' " : End If
  61. SQL_支付對象選單()
  62. da.Fill(ds1) : 支付對象1_dgv.DataSource = ds1.Tables(0) : conn.Close()
  63. Dim ds2 As New DataSet : 支付對象2_dgv.DataSource = Nothing : ds2.Clear()
  64. 支付對象2_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  65. 支付對象2_dgv.ColumnHeadersHeight = 40 : 支付對象2_dgv.AllowUserToAddRows = False
  66. If 公司類別_cb.Text = "PT" Then : SQL2 = " AND 支付對象 LIKE N'PT%'"
  67. ElseIf 公司類別_cb.Text = "CV" Then : SQL2 = " AND 支付對象 LIKE N'CV%'"
  68. ElseIf 公司類別_cb.Text = "UD" Then : SQL2 = " AND 支付對象 LIKE N'UD%'"
  69. ElseIf 公司類別_cb.Text = "NA" Or 公司類別_cb.Text = "" Then : SQL2 = " AND 支付對象 NOT LIKE N'CV%' AND 支付對象 NOT LIKE N'PT%' AND 支付對象 NOT LIKE N'UD%' " : End If
  70. SQL_支付對象選單2()
  71. da.Fill(ds2) : 支付對象2_dgv.DataSource = ds2.Tables(0) : conn.Close()
  72. 支付對象_cb.Items.Clear()
  73. For i As Integer = 0 To 支付對象1_dgv.Rows.Count - 1
  74. 支付對象_cb.Items.Add("A-" & 支付對象1_dgv.Rows(i).Cells(1).Value.ToString)
  75. Next
  76. For j As Integer = 0 To 支付對象2_dgv.Rows.Count - 1
  77. Dim 要加入cb As Boolean = True
  78. Dim 要加入的文字 As String = 支付對象2_dgv.Rows(j).Cells(0).Value.ToString
  79. For k As Integer = 0 To 支付對象1_dgv.Rows.Count - 1
  80. If 要加入的文字 = 支付對象1_dgv.Rows(k).Cells(2).Value.ToString Then
  81. 要加入cb = False
  82. Exit For
  83. End If
  84. Next
  85. If 要加入cb Then
  86. 支付對象_cb.Items.Add("B-" & 要加入的文字)
  87. End If
  88. Next
  89. End Sub
  90. Private Sub 公司類別_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 公司類別_cb.SelectedIndexChanged
  91. 載入支付對象()
  92. End Sub
  93. Private Sub Set_清單1()
  94. Dim ds1 As New DataSet : 財務收支單_dgv.DataSource = Nothing : ds1.Clear()
  95. 財務收支單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  96. 財務收支單_dgv.ColumnHeadersHeight = 40 : 財務收支單_dgv.AllowUserToAddRows = False
  97. If 條件_cb.Text = "N/A" Then
  98. SQL2 = " AND (財務收支控制表.審核人 IS NULL OR 財務收支控制表.審核人 LIKE '') "
  99. ElseIf 條件_cb.Text = "App" Then
  100. SQL2 = " AND (財務收支控制表.審核人 NOT LIKE '') AND (財務收支控制表.審核人 NOT LIKE N'作廢%') AND (財務收支控制表.審核人 IS NOT NULL) "
  101. ElseIf 條件_cb.Text = "Void" Then
  102. SQL2 = " AND (財務收支控制表.審核人 LIKE N'作廢-%') "
  103. End If
  104. If 跨部門開啟 = False Then '-------申請登入時
  105. PA25 = 部門選單_cb.Text & SK2 & SK1 & 年份2_cb.Text
  106. Dim 時間條件 As String = "AND (財務收支明細表.支付日期 BETWEEN '" & Strings.Format(開始日期_dtp.Value, "yyyy/MM/dd") & "' AND
  107. '" & Strings.Format(結束日期_dtp.Value, "yyyy/MM/dd") & "') "
  108. Dim 條件 As String
  109. If HX_ch.Checked Then : 條件 = " AND (財務收支明細表.流水號 LIKE N'%HXI%') "
  110. ElseIf PGS_ch.Checked Then : 條件 = " AND (財務收支明細表.流水號 LIKE N'%PGS%') " : Else : 條件 = "" : End If
  111. SQL_財物支付單申請_查詢財務收支控制表(時間條件, 條件)
  112. ElseIf 跨部門開啟 = True Then '-------審核登入時
  113. Dim 條件, 時間條件, 審核條件 As String
  114. If HX_ch.Checked Then : 條件 = " AND (財務收支明細表.流水號 LIKE N'%HXI%') " '審X主X O
  115. ElseIf PGS_ch.Checked Then : 條件 = " AND (財務收支明細表.流水號 LIKE N'%PGS%') " '審O主X X
  116. Else : 條件 = "" : End If '審O主O O
  117. 時間條件 = "AND (財務收支明細表.支付日期 BETWEEN '" & Strings.Format(開始日期_dtp.Value, "yyyy/MM/dd") & "' AND '" & Strings.Format(結束日期_dtp.Value, "yyyy/MM/dd") & "') "
  118. 審核條件 = ""
  119. SQL_財物支付單申請_查詢財務收支控制表1(條件, 時間條件, 審核條件)
  120. End If : SQL2 = ""
  121. da.Fill(ds1) : 財務收支單_dgv.DataSource = ds1.Tables(0) : conn.Close()
  122. 財務收支單_dgv.Columns(0).FillWeight = 125 : 財務收支單_dgv.Columns(1).FillWeight = 75 : 財務收支單_dgv.Columns(2).FillWeight = 120
  123. 財務收支單_dgv.Columns(11).FillWeight = 40 : 財務收支單_dgv.Columns(12).FillWeight = 40
  124. 財務收支單_dgv.Columns("核准圖檔").Visible = False : 財務收支單_dgv.Columns(11).Visible = False : 財務收支單_dgv.Columns(12).Visible = False
  125. 財務收支單_dgv.Columns("檢查人").Visible = False : 財務收支單_dgv.Columns("主管人").Visible = False : 財務收支單_dgv.Columns("申請日期").Visible = False
  126. For I As Integer = 3 To 10 : 財務收支單_dgv.Columns(I).Visible = False : Next : For I As Integer = 13 To 15 : 財務收支單_dgv.Columns(I).Visible = False : Next
  127. 財務收支單_dgv.Columns(0).ReadOnly = True : 財務收支單_dgv.Columns(1).ReadOnly = True : 財務收支單_dgv.Columns(2).ReadOnly = True
  128. For I As Integer = 0 To 財務收支單_dgv.Rows.Count - 1
  129. 財務收支單_dgv.Rows(I).Cells(11).Value = False : 財務收支單_dgv.Rows(I).Cells(12).Value = False
  130. If Strings.Left(財務收支單_dgv.Rows(I).Cells(10).Value.ToString, 2) = "作廢" Or Strings.Left(財務收支單_dgv.Rows(I).Cells("主管人").Value.ToString, 2) = "作廢" Then
  131. 財務收支單_dgv.Rows(I).Cells(12).Value = True
  132. End If
  133. If 財務收支單_dgv.Rows(I).Cells("主管人").Value.ToString <> "" Then
  134. If 財務收支單_dgv.Rows(I).Cells("主管人").Value.ToString.Substring(0, 2) <> "作廢" Then
  135. 財務收支單_dgv.Rows(I).Cells(11).Value = True
  136. End If
  137. End If
  138. Next
  139. End Sub
  140. Private Sub 部門選單下拉清單讀取()
  141. SQL_部門選單() : 部門選單_cb.Items.Clear() : While (dr.Read()) : 部門選單_cb.Items.Add(dr("部門")) : End While : conn.Close()
  142. End Sub
  143. Private Sub 第三層下拉表單資料載入()
  144. PA26 = 編號2_cb.Text : SQL_財務單會計科目3() : 第三層_cb.Items.Clear() : 編號3_cb.Items.Clear() : 第三層_cb.Items.Add("") : 編號3_cb.Items.Add("")
  145. While (dr.Read()) : 第三層_cb.Items.Add(dr("會計科目")) : 編號3_cb.Items.Add(dr("編號")) : End While : conn.Close()
  146. If 第三層_cb.Items.Count <> 0 Then : 第三層_cb.SelectedIndex = 0 : End If
  147. End Sub
  148. Private Sub 第一層下拉表單資料載入()
  149. SQL_財務單會計科目1() : 第一層_cb.Items.Clear() : 編號1_cb.Items.Clear()
  150. While (dr.Read()) : 第一層_cb.Items.Add(dr("第一階")) : 編號1_cb.Items.Add(dr("編號")) : End While : conn.Close() : 第一層_cb.Text = "" : 編號1_cb.Text = ""
  151. End Sub
  152. Private Sub 第二層下拉表單資料載入()
  153. PA25 = 編號1_cb.Text : SQL_財務單會計科目2() : 第二層_cb.Items.Clear() : 編號2_cb.Items.Clear() : 第二層_cb.Items.Add("") : 編號2_cb.Items.Add("")
  154. While (dr.Read()) : 第二層_cb.Items.Add(dr("第二階")) : 編號2_cb.Items.Add(dr("編號")) : End While : conn.Close() : 第二層_cb.Text = "" : 編號2_cb.Text = ""
  155. End Sub
  156. Private Sub 匯率()
  157. SQL_營運成本收支單申請_查詢匯率()
  158. If dr.Read() Then
  159. 人民幣匯率_tb.Text = dr("中心匯率").ToString : 美金匯率_tb.Text = dr("美金匯率").ToString : 印尼匯率_tb.Text = dr("印尼盾").ToString : conn.Close() : dr.Close()
  160. Else : conn.Close() : dr.Close() : 匯率管理.Close() : 匯率管理.Show() : 匯率管理.BringToFront() : End If
  161. End Sub
  162. Private Sub Set_切換格式()
  163. 明細_dgv.DataSource = Nothing : 單號_tb.Text = "" : 申請人_tb.Text = ""
  164. 第三層下拉表單資料載入() : Set_清單1()
  165. End Sub
  166. Private Sub 財物支付單申請_傳票_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  167. 已開啟 = False
  168. If 跨部門開啟 = False Then : Me.AutoScroll = True : 首次開啟 = True : 申請_p.Visible = True : 審核_p.Visible = False
  169. ElseIf 跨部門開啟 = True Then : Me.MdiParent = HX_PGS_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True : 首次開啟 = True : 申請_p.Visible = False : 審核_p.Visible = True : End If
  170. 年份2_cb.Text = Year(Today) : 月份2_cb.SelectedIndex = Month(Today) - 1 : Panel1.SendToBack() : 條件_cb.Text = "N/A" : 支付日期_dtp.Enabled = False
  171. 風格() : H(314) = True : 介面 = "H314" : 語言轉換讀取() : 第一層下拉表單資料載入() : 幣別_cb.Text = "IDR" : 顯示說明(999, False)
  172. MyMod.清單字體大小調整()
  173. 財務收支單_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  174. 已開啟 = True
  175. End Sub
  176. Private Sub 財物支付單申請_傳票_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
  177. 公司類別_cb.SelectedIndex = 0 : 部門選單下拉清單讀取() : 載入支付對象()
  178. SQL_主管名稱(2, 23) : If dr.Read Then : 出納人員 = dr("姓名").ToString : End If
  179. If 跨部門開啟 = False Then : CB選擇清單(部門選單_cb, 部門選單_cb.Text) : CB選擇清單(選擇公司_cb, 選擇公司_cb.Text) : End If
  180. 月_ch.Checked = True : 週_ch.Checked = False : 日_ch.Checked = False : HX_ch.Checked = False : PGS_ch.Checked = False : ALL_ch.Checked = True
  181. 當月_bt.PerformClick()
  182. If PA48 = "採購" Then : 匯率() : 開立收支單_bt.Visible = False : 申請完成_bt.Visible = False : 首次開啟 = False
  183. Else : 匯率() : 幣別_cb.SelectedIndex = 3 : 編號1_cb.Text = "B-02" : 首次開啟 = False : End If : PA48 = "" : 修改BT()
  184. End Sub
  185. Private Sub 財物支付單申請_傳票_Closed(sender As Object, e As EventArgs) Handles MyBase.Closed
  186. If 跨部門開啟 = False Then : H(314) = False : 跨部門開啟 = False
  187. ElseIf 跨部門開啟 = True Then : H(314) = False : 跨部門開啟 = False : MyMod.虛擬桌面開啟() : End If
  188. End Sub
  189. Private Sub 語轉扭_bt_Click(sender As Object, e As EventArgs) Handles 語轉扭_bt.Click
  190. 介面 = "H314" : 語言轉換讀取() : Set_清單1() : 第一層下拉表單資料載入() : 幣別_cb.SelectedIndex = 3 : 編號1_cb.Text = "B-02" : 修改BT() : Set_清單1()
  191. End Sub
  192. Private Sub 登入閒置控制_MouseMove(sender As Object, e As EventArgs) Handles MyBase.MouseMove
  193. timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
  194. End Sub
  195. Private Sub 登入閒置控制_KeyPress(sender As Object, e As EventArgs) Handles MyBase.KeyPress
  196. timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
  197. End Sub
  198. Private Sub 財務收支單_dgv_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles 財務收支單_dgv.CellClick
  199. If e.RowIndex = -1 Then : Else
  200. 單號_tb.Text = 財務收支單_dgv(0, e.RowIndex).Value.ToString : 申請日期_dtp.Value = 財務收支單_dgv("申請日期", e.RowIndex).Value.ToString
  201. 申請人_tb.Text = 財務收支單_dgv(2, e.RowIndex).Value.ToString : 系統單號_bt.Text = 財務收支單_dgv(3, e.RowIndex).Value.ToString
  202. 幣別_cb.Text = 財務收支單_dgv(4, e.RowIndex).Value.ToString : 編號1_cb.Text = Strings.Left(財務收支單_dgv("類別", e.RowIndex).Value.ToString, 4)
  203. 編號2_cb.Text = Strings.Left(財務收支單_dgv("類別", e.RowIndex).Value.ToString, 7) : 編號3_cb.Text = 財務收支單_dgv("類別", e.RowIndex).Value.ToString
  204. 金額大寫_tb.Text = 財務收支單_dgv("大寫", e.RowIndex).Value.ToString : 部門選單_cb.Text = Strings.Mid(財務收支單_dgv(0, e.RowIndex).Value.ToString, 5, 3)
  205. 內容_tb.Text = 財務收支單_dgv("明細", e.RowIndex).Value.ToString : 支付對象_tb.Text = 財務收支單_dgv("支付對象", e.RowIndex).Value.ToString
  206. 營行帳號_tb.Text = 財務收支單_dgv("公司", e.RowIndex).Value.ToString : 支付銀行_tb.Text = 財務收支單_dgv("付款銀行", e.RowIndex).Value.ToString
  207. 銀行支行_tb.Text = 財務收支單_dgv("銀行支行", e.RowIndex).Value.ToString : 檢查人_tb.Text = 財務收支單_dgv("檢查人", e.RowIndex).Value.ToString
  208. 主管_tb.Text = "sinta nuriyani" : 支付對象_cb.Text = 財務收支單_dgv("支付對象", e.RowIndex).Value.ToString
  209. If 財務收支單_dgv(1, e.RowIndex).Value.ToString <> "" Then : 支付日期_dtp.Value = 財務收支單_dgv(1, e.RowIndex).Value : Else : 支付日期_dtp.Value = Today : End If
  210. If 財務收支單_dgv(11, e.RowIndex).Value = True Or 財務收支單_dgv(12, e.RowIndex).Value = True Then : 不可編輯x = True : Else : 不可編輯x = False : End If
  211. If Strings.Left(財務收支單_dgv.Rows(e.RowIndex).Cells(10).Value.ToString, 2) = "作廢" Then
  212. 審核人_tb.Text = 系統語言字典("H314-111-" & 語言) & Strings.Mid(財務收支單_dgv("審核人", e.RowIndex).Value.ToString, 3, 50)
  213. Else : 審核人_tb.Text = 財務收支單_dgv("審核人", e.RowIndex).Value.ToString : End If
  214. 申請金額_nud.Value = CLng(財務收支單_dgv("支出", e.RowIndex).Value.ToString) : 大寫轉換()
  215. If 財務收支單_dgv(0, e.RowIndex).Value.ToString.Contains("HXI") Then : PictureBox1.BringToFront()
  216. ElseIf 財務收支單_dgv(0, e.RowIndex).Value.ToString.Contains("PGS") Then : PictureBox1.SendToBack() : Else : PictureBox1.BringToFront() : End If
  217. End If
  218. End Sub
  219. Private Sub 申請人_tb_TextChanged(sender As Object, e As EventArgs) Handles 申請人_tb.TextChanged
  220. PA1 = 申請人_tb.Text : SQL_主管簽名檔讀取() : 簽名圖1_pb.Image = Nothing
  221. While dr.Read() = True : Dim unused As Byte() = New Byte(-1) {} : Dim bytes As Byte() = DirectCast(dr.Item("簽名檔圖片"), Byte()) : Dim oStream As New MemoryStream(bytes)
  222. 簽名圖1_pb.Image = Bitmap.FromStream(oStream)
  223. End While : conn.Close() : 簽名圖1_pb.SizeMode = 4
  224. End Sub
  225. Private Sub 檢查人_tb_TextChanged(sender As Object, e As EventArgs) Handles 檢查人_tb.TextChanged
  226. PA1 = 檢查人_tb.Text : SQL_主管簽名檔讀取() : 簽名圖2_pb.Image = Nothing
  227. While dr.Read() = True : Dim unused As Byte() = New Byte(-1) {} : Dim bytes As Byte() = DirectCast(dr.Item("簽名檔圖片"), Byte()) : Dim oStream As New MemoryStream(bytes)
  228. 簽名圖2_pb.Image = Bitmap.FromStream(oStream)
  229. End While : conn.Close() : 簽名圖2_pb.SizeMode = 4
  230. End Sub
  231. Private Sub 主管_tb_TextChanged(sender As Object, e As EventArgs) Handles 主管_tb.TextChanged
  232. PA1 = 主管_tb.Text : SQL_主管簽名檔讀取() : 簽名圖3_pb.Image = Nothing
  233. While dr.Read() = True : Dim unused As Byte() = New Byte(-1) {} : Dim bytes As Byte() = DirectCast(dr.Item("簽名檔圖片"), Byte()) : Dim oStream As New MemoryStream(bytes)
  234. 簽名圖3_pb.Image = Bitmap.FromStream(oStream)
  235. End While : conn.Close() : 簽名圖3_pb.SizeMode = 4
  236. End Sub
  237. Private Sub 審核人_tb_TextChanged(sender As Object, e As EventArgs) Handles 審核人_tb.TextChanged
  238. PA1 = 審核人_tb.Text : SQL_主管簽名檔讀取() : 簽名圖4_pb.Image = Nothing
  239. While dr.Read() = True : Dim unused As Byte() = New Byte(-1) {} : Dim bytes As Byte() = DirectCast(dr.Item("簽名檔圖片"), Byte()) : Dim oStream As New MemoryStream(bytes)
  240. 簽名圖4_pb.Image = Bitmap.FromStream(oStream)
  241. End While : conn.Close() : 簽名圖4_pb.SizeMode = 4
  242. End Sub
  243. Private Sub ComboBox5_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 第一層_cb.TextChanged
  244. 編號1_cb.SelectedIndex = 第一層_cb.SelectedIndex : 查詢_tb.Text = "" : 第二層下拉表單資料載入() : 第三層下拉表單資料載入()
  245. End Sub
  246. Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 編號1_cb.TextChanged
  247. 第一層_cb.SelectedIndex = 編號1_cb.SelectedIndex : 第二層下拉表單資料載入() : 第三層下拉表單資料載入()
  248. End Sub
  249. Private Sub ComboBox3_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 第二層_cb.TextChanged
  250. 編號2_cb.SelectedIndex = 第二層_cb.SelectedIndex : 第三層下拉表單資料載入()
  251. End Sub
  252. Private Sub ComboBox4_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 編號2_cb.TextChanged
  253. 第二層_cb.SelectedIndex = 編號2_cb.SelectedIndex : 第三層下拉表單資料載入()
  254. End Sub
  255. Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 第三層_cb.SelectedIndexChanged
  256. 編號3_cb.SelectedIndex = 第三層_cb.SelectedIndex
  257. End Sub
  258. Private Sub ComboBox6_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 編號3_cb.SelectedIndexChanged
  259. 第三層_cb.SelectedIndex = 編號3_cb.SelectedIndex
  260. End Sub
  261. Private Sub 部門選單_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 部門選單_cb.SelectedIndexChanged
  262. If 首次開啟 = False Then : Set_清單1() : End If
  263. End Sub
  264. Private Sub 部門選單_cb_Click(sender As Object, e As EventArgs) Handles 部門選單_cb.Click
  265. CB選擇清單(部門選單_cb, 部門選單_cb.Text)
  266. End Sub
  267. Private Sub 重選部門_bt_Click(sender As Object, e As EventArgs) Handles 重選部門_bt.Click
  268. CB選擇清單(部門選單_cb, 部門選單_cb.Text) : CB選擇清單(選擇公司_cb, 選擇公司_cb.Text)
  269. End Sub
  270. Private Sub 第二層_cb_Click(sender As Object, e As EventArgs) Handles 第二層_cb.Click
  271. CB選擇清單(第二層_cb, 第二層_cb.Text)
  272. End Sub
  273. Private Sub 第三層_cb_Click(sender As Object, e As EventArgs) Handles 第三層_cb.Click
  274. CB選擇清單(第三層_cb, 第三層_cb.Text)
  275. End Sub
  276. Private Sub 選擇公司_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 選擇公司_cb.SelectedIndexChanged
  277. If 選擇公司_cb.Text = "PT HONG XHE INDUSTRIAL" Then : PictureBox1.BringToFront() : SK2 = "/HXI-PP/" : Else : PictureBox1.SendToBack() : SK2 = "/PGS-PP/" : End If
  278. If 首次開啟 = False Then : Set_清單1() : End If
  279. End Sub
  280. Private Sub 申請日期_dtp_ValueChanged(sender As Object, e As EventArgs) Handles 申請日期_dtp.ValueChanged
  281. 匯率()
  282. End Sub
  283. Private Sub 年份2_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 年份2_cb.SelectedIndexChanged
  284. If 首次開啟 = False Then : Set_清單1() : End If
  285. End Sub
  286. Private Sub 年份2_cb_Click(sender As Object, e As EventArgs) Handles 年份2_cb.Click
  287. CB選擇清單(年份2_cb, 年份2_cb.Text)
  288. End Sub
  289. Private Sub 月份2_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 月份2_cb.SelectedIndexChanged
  290. If 月份2_cb.Text = "01" Then : SK1 = "I/" : ElseIf 月份2_cb.Text = "02" Then : SK1 = "II/" : ElseIf 月份2_cb.Text = "03" Then : SK1 = "III/"
  291. ElseIf 月份2_cb.Text = "04" Then : SK1 = "IV/" : ElseIf 月份2_cb.Text = "05" Then : SK1 = "V/" : ElseIf 月份2_cb.Text = "06" Then : SK1 = "VI/"
  292. ElseIf 月份2_cb.Text = "07" Then : SK1 = "VII/" : ElseIf 月份2_cb.Text = "08" Then : SK1 = "VIII/" : ElseIf 月份2_cb.Text = "09" Then : SK1 = "IX/"
  293. ElseIf 月份2_cb.Text = "10" Then : SK1 = "X/" : ElseIf 月份2_cb.Text = "11" Then : SK1 = "XI/" : ElseIf 月份2_cb.Text = "12" Then : SK1 = "XII/" : End If
  294. If 首次開啟 = False Then : Set_清單1() : End If
  295. End Sub
  296. Private Sub 月份2_cb_Click(sender As Object, e As EventArgs) Handles 月份2_cb.Click
  297. CB選擇清單(月份2_cb, 月份2_cb.Text)
  298. End Sub
  299. Private Sub Set_日期格式轉換()
  300. If 補單_cb.Checked = False Then : DTP = Strings.Format(Today(), "yyyy/MM/dd") : DTP1 = Strings.Format(Today(), "yyyyMMdd")
  301. Else : DTP1 = Strings.Format(申請日期_dtp.Value, "yyyyMMdd") : DTP = Strings.Format(申請日期_dtp.Value, "yyyy/MM/dd") : End If
  302. End Sub
  303. Private Sub Set_流水號()
  304. Dim NUM1 As Integer
  305. For NUM1 = 0 To 99
  306. Dim d As String : Dim f As String : Dim g As Integer = 1
  307. If Month(Now) < 10 Then : d = "0" & CStr(Month(Now)) : Else : d = CStr(Month(Now)) : End If
  308. If Now.Day() < 10 Then : f = "0" & CStr(Now.Day()) : Else : f = CStr(Now.Day()) : End If
  309. If NUM1 < 10 Then : 新流水1 = "B" & Microsoft.VisualBasic.Right(CStr(Year(Now)), 2) & d & f & "0" & NUM1
  310. Else : 新流水1 = "B" & Microsoft.VisualBasic.Right(CStr(Year(Now)), 2) & d & f & NUM1 : End If : PA19 = 新流水1
  311. SQL_營運成本收支單申請_查詢收支單公帳流水號()
  312. If dr.Read() Then : conn.Close() : Else : conn.Close() : NUM1 = 99 : End If
  313. Next
  314. End Sub
  315. Private Sub 開立收支單_bt_Click(sender As Object, e As EventArgs) Handles 開立收支單_bt.Click
  316. If 編號3_cb.Text = "" Or 幣別_cb.Text = "" Then : MGB(對話框(2), 1) : 首次開啟 = False : Else : 不可編輯x = False
  317. If 補單_cb.Checked = False Then : 申請日期_dtp.Value = Today() : End If : 申請人_tb.Text = gUserName
  318. Dim today1 As Date = Date.Today
  319. Dim dayOfWeek As DayOfWeek = today.DayOfWeek
  320. Dim daysToAdd As Integer = If(dayOfWeek <= DayOfWeek.Friday, DayOfWeek.Friday - dayOfWeek, 7 - (dayOfWeek - DayOfWeek.Friday))
  321. Dim nextFriday As Date = today1.AddDays(daysToAdd)
  322. 支付日期_dtp.Value = nextFriday ' 將 DateTimePicker 控制元件的值設置為下個星期五
  323. Dim NUM1 As Integer
  324. Set_日期格式轉換()
  325. For i As Integer = 1 To 999
  326. NUM1 = 0 + i
  327. If NUM1 < 10 Then : 系統單號_bt.Text = "OE-" & DTP1 & "-00" & NUM1
  328. ElseIf NUM1 > 9 And NUM1 < 100 Then : 系統單號_bt.Text = "OE-" & DTP1 & "-0" & NUM1
  329. ElseIf NUM1 > 99 Then : 系統單號_bt.Text = "OE-" & DTP1 & "-" & NUM1
  330. End If : conn.Close() : PA = 系統單號_bt.Text : PA15 = 系統單號_bt.Text
  331. SQL_營運成本收支單申請_查詢第一筆公帳支付單號()
  332. If dr.Read() Then : Else : i = 999 : conn.Close() : End If : conn.Close()
  333. Next : SQL_營運成本收支單申請_新增一筆財務收支控制表() : conn.Close() : 申請人_tb.Text = gUserName
  334. 月份2_cb.Text = Strings.Mid(Strings.Format(申請日期_dtp.Value, "yyyy/MM/dd"), 6, 2)
  335. PA25 = 部門選單_cb.Text & SK2 & SK1 & 年份2_cb.Text : SQL_財物支付單申請_查詢最後一筆公帳支付單號()
  336. If dr.Read() Then : 單號_tb.Text = Strings.Left(dr("流水號").ToString, 3) : Else : 單號_tb.Text = "000" : End If : conn.Close()
  337. 單號_tb.Text = CInt(單號_tb.Text) + 1
  338. If CInt(單號_tb.Text) < 10 Then : 單號_tb.Text = "00" & CInt(單號_tb.Text)
  339. ElseIf CInt(單號_tb.Text) > 9 And CInt(單號_tb.Text) < 100 Then : 單號_tb.Text = "0" & CInt(單號_tb.Text)
  340. ElseIf CInt(單號_tb.Text) > 99 And CInt(單號_tb.Text) < 1000 Then : 單號_tb.Text = CInt(單號_tb.Text) : End If
  341. 單號_tb.Text = 單號_tb.Text & "-" & 部門選單_cb.Text & SK2 & SK1 & 年份2_cb.Text
  342. PA19 = 單號_tb.Text : 新項次 = "01" : PA11 = 新項次
  343. 指定會科 = 編號3_cb.Text : PA13 = "0" : PA14 = 申請金額_nud.Value : PA12 = 內容_tb.Text : PA37 = "" : PA38 = 金額大寫_tb.Text : PA39 = 支付對象_tb.Text
  344. PA40 = 營行帳號_tb.Text : PA41 = 支付銀行_tb.Text : PA42 = 銀行支行_tb.Text
  345. If 幣別_cb.Text = "TWD" Then : 匯率1 = 1 / CDbl(印尼匯率_tb.Text)
  346. ElseIf 幣別_cb.Text = "RMB" Then : 匯率1 = CDbl(人民幣匯率_tb.Text) / CDbl(印尼匯率_tb.Text)
  347. ElseIf 幣別_cb.Text = "USD" Then : 匯率1 = CDbl(美金匯率_tb.Text) / CDbl(印尼匯率_tb.Text)
  348. ElseIf 幣別_cb.Text = "IDR" Then : 匯率1 = 1
  349. End If : PA16 = 匯率1
  350. SQL_新增財物支付單明細表資料(Strings.Format(支付日期_dtp.Value, "yyyy/MM/dd")) : Set_清單1()
  351. End If
  352. End Sub
  353. Private Sub 開立收支單1_bt_Click(sender As Object, e As EventArgs) Handles 開立收支單1_bt.Click
  354. If 編號3_cb.Text = "" Or 幣別_cb.Text = "" Then : MGB(對話框(2), 1) : 首次開啟 = False : Else : 不可編輯x = False
  355. If 補單_cb.Checked = False Then : 申請日期_dtp.Value = Today() : End If : 申請人_tb.Text = gUserName
  356. Dim NUM1 As Integer
  357. Set_日期格式轉換()
  358. For i As Integer = 1 To 999
  359. NUM1 = 0 + i
  360. If NUM1 < 10 Then : 系統單號_bt.Text = "OE-" & DTP1 & "-00" & NUM1
  361. ElseIf NUM1 > 9 And NUM1 < 100 Then : 系統單號_bt.Text = "OE-" & DTP1 & "-0" & NUM1
  362. ElseIf NUM1 > 99 Then : 系統單號_bt.Text = "OE-" & DTP1 & "-" & NUM1
  363. End If : conn.Close() : PA = 系統單號_bt.Text : PA15 = 系統單號_bt.Text
  364. SQL_營運成本收支單申請_查詢第一筆公帳支付單號()
  365. If dr.Read() Then : Else : i = 999 : conn.Close() : End If : conn.Close()
  366. Next : SQL_營運成本收支單申請_新增一筆財務收支控制表() : conn.Close() : 申請人_tb.Text = gUserName
  367. 月份2_cb.Text = Strings.Mid(Strings.Format(申請日期_dtp.Value, "yyyy/MM/dd"), 6, 2)
  368. PA25 = 部門選單_cb.Text & SK2 & SK1 & 年份2_cb.Text : SQL_財物支付單申請_查詢最後一筆公帳支付單號()
  369. If dr.Read() Then : 單號_tb.Text = Strings.Left(dr("流水號").ToString, 3) : Else : 單號_tb.Text = "000" : End If : conn.Close()
  370. 單號_tb.Text = CInt(單號_tb.Text) + 1
  371. If CInt(單號_tb.Text) < 10 Then : 單號_tb.Text = "00" & CInt(單號_tb.Text)
  372. ElseIf CInt(單號_tb.Text) > 9 And CInt(單號_tb.Text) < 100 Then : 單號_tb.Text = "0" & CInt(單號_tb.Text)
  373. ElseIf CInt(單號_tb.Text) > 99 And CInt(單號_tb.Text) < 1000 Then : 單號_tb.Text = CInt(單號_tb.Text) : End If
  374. 單號_tb.Text = 單號_tb.Text & "-" & 部門選單_cb.Text & SK2 & SK1 & 年份2_cb.Text
  375. PA19 = 單號_tb.Text : 新項次 = "01" : PA11 = 新項次
  376. 指定會科 = 編號3_cb.Text : PA13 = "0" : PA14 = 申請金額_nud.Value : PA12 = 內容_tb.Text : PA37 = "" : PA38 = 金額大寫_tb.Text : PA39 = 支付對象_tb.Text
  377. PA40 = 營行帳號_tb.Text : PA41 = 支付銀行_tb.Text : PA42 = 銀行支行_tb.Text
  378. If 幣別_cb.Text = "TWD" Then : 匯率1 = 1 / CDbl(印尼匯率_tb.Text)
  379. ElseIf 幣別_cb.Text = "RMB" Then : 匯率1 = CDbl(人民幣匯率_tb.Text) / CDbl(印尼匯率_tb.Text)
  380. ElseIf 幣別_cb.Text = "USD" Then : 匯率1 = CDbl(美金匯率_tb.Text) / CDbl(印尼匯率_tb.Text)
  381. ElseIf 幣別_cb.Text = "IDR" Then : 匯率1 = 1
  382. End If : PA16 = 匯率1
  383. SQL_新增財物支付單明細表資料(Strings.Format(支付日期_dtp.Value, "yyyy/MM/dd")) : Set_清單1()
  384. End If
  385. End Sub
  386. Private Sub 刪除收支單_bt_Click(sender As Object, e As EventArgs) Handles 刪除收支單_bt.Click
  387. If 不可編輯x = False Then
  388. If 系統單號_bt.Text = "" Then : MGB(對話框(3), 1) : 首次開啟 = False : Else
  389. MGB(對話框(4), 2)
  390. If 訊息回應 = "YES" Then
  391. PA20 = 單號_tb.Text
  392. Dim ds1 As New DataSet : 採購連結_dgv.DataSource = Nothing : ds1.Clear()
  393. 採購連結_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  394. 採購連結_dgv.ColumnHeadersHeight = 40 : 採購連結_dgv.AllowUserToAddRows = False
  395. SQL_財務採購關聯表_反改查詢()
  396. da.Fill(ds1) : 採購連結_dgv.DataSource = ds1.Tables(0) : conn.Close()
  397. For I As Integer = 0 To 採購連結_dgv.Rows.Count - 1
  398. PA21 = 採購連結_dgv.Rows(I).Cells("採購單號").Value.ToString : SQL_採購單控制表_反改查詢()
  399. If dr.Read Then : PA22 = CLng(dr("轉財務金額").ToString) - CLng(採購連結_dgv.Rows(I).Cells("轉財務金額").Value.ToString) : End If
  400. SQL_採購單控制表_反改()
  401. Next
  402. SQL_財務採購關聯表_反改()
  403. PA45 = 系統單號_bt.Text : SQL_營運成本收支單申請_刪除財務收支控制表() : SQL_營運成本收支單申請_刪除財務收支明細表() : conn.Close()
  404. 第二層_cb.Text = "" : 編號2_cb.Text = "" : 第三層_cb.Text = "" : 編號3_cb.Text = "" : 申請金額_nud.Value = 0
  405. 單號_tb.Text = "" : 申請人_tb.Text = "" : 金額大寫_tb.Text = "" : 內容_tb.Text = "" : 支付對象_tb.Text = "" : Set_清單1()
  406. End If : 首次開啟 = False
  407. End If
  408. Else : MGB(對話框(8), 1) : 首次開啟 = False : End If
  409. End Sub
  410. Private Sub 申請完成_bt_Click(sender As Object, e As EventArgs) Handles 申請完成_bt.Click
  411. If 不可編輯x = False Then
  412. If 系統單號_bt.Text = "" Then : MGB(對話框(3), 1) : 首次開啟 = False : Else
  413. PA1 = 內容_tb.Text : PA2 = 申請金額_nud.Value : PA4 = 編號3_cb.Text : PA3 = 金額大寫_tb.Text : PA6 = 系統單號_bt.Text : PA9 = "01"
  414. PA7 = 營行帳號_tb.Text : PA8 = 支付銀行_tb.Text : PA10 = 銀行支行_tb.Text : If 支付對象_tb.Text = "" Then : 支付對象_tb.Text = 支付對象_cb.Text : End If
  415. PA5 = 支付對象_tb.Text
  416. SQL_財物支付單修改(Strings.Format(支付日期_dtp.Value, "yyyy/MM/dd")) : Set_清單1() : MGB(對話框(1), 1) : 首次開啟 = False
  417. End If
  418. Else
  419. If 登入人級別 = "00" Then
  420. PA1 = 內容_tb.Text : PA2 = 申請金額_nud.Value : PA4 = 編號3_cb.Text : PA3 = 金額大寫_tb.Text : PA6 = 系統單號_bt.Text : PA9 = "01"
  421. PA7 = 營行帳號_tb.Text : PA8 = 支付銀行_tb.Text : PA10 = 銀行支行_tb.Text : If 支付對象_tb.Text = "" Then : 支付對象_tb.Text = 支付對象_cb.Text : End If
  422. PA5 = 支付對象_tb.Text
  423. SQL_財物支付單修改(Strings.Format(支付日期_dtp.Value, "yyyy/MM/dd")) : Set_清單1() : MGB(對話框(1), 1) : 首次開啟 = False
  424. End If
  425. MGB(對話框(8), 1) : 首次開啟 = False
  426. End If
  427. 解開星期五_ch.Checked = False : 支付日期_dtp.Enabled = False
  428. End Sub
  429. Private Sub 檢查人_bt_Click(sender As Object, e As EventArgs) Handles 檢查人_bt.Click
  430. If CInt(登入人級別) <= 5 Then
  431. If 檢查人_tb.Text = "" Then
  432. 檢查人_tb.Text = gUserName : SQL_財物支付單修改_檢查人(系統單號_bt.Text, 檢查人_tb.Text)
  433. LIN訊息通知("CC209", 出納人員, gUserName, "七日內") : LIN訊息通知("CC209", "李協叡", gUserName, "七日內")
  434. End If
  435. End If
  436. End Sub
  437. Private Sub 主管_bt_Click(sender As Object, e As EventArgs) Handles 主管_bt.Click
  438. 主管_tb.Text = "sinta nuriyani"
  439. End Sub
  440. Private Sub 審核通過_bt_Click(sender As Object, e As EventArgs) Handles 審核通過_bt.Click
  441. If 系統單號_bt.Text = "" Then : MGB(對話框(3), 1) : 首次開啟 = False : Else
  442. Set_日期格式轉換()
  443. If gUserName = 出納人員 Then : SQL_簽名檔查詢(出納人員) : If dr.Read Then : PA27 = dr("圖片流水號").ToString : Else : PA27 = "PG00000004" : End If
  444. Else : PA27 = "" : End If : PA28 = "" : PA29 = 系統單號_bt.Text
  445. SQL_營運成本收支單審核_修改財務收支控制表()
  446. SQL_營運成本收支單審核_修改財務收支明細表()
  447. PA1 = "01" : SQL_營運成本收支單審核_修改財務收支明細表備用金() : SQL_營運成本收支單審核_修改財務收支明細表現金() : SQL_營運成本收支單審核_修改財務收支明細表支出()
  448. SQL_營運成本收支單審核_修改財務收支明細表支付日期(Strings.Format(支付日期_dtp.Value, "yyyy/MM/dd"))
  449. MGB(對話框(5), 1) : 首次開啟 = False : Set_清單1()
  450. LIN訊息通知("CC212", "LIN HSING HAO", 單號_tb.Text, Strings.Format(支付日期_dtp.Value, "yyyy/MM/dd"))
  451. LIN訊息通知("CC212", "李協叡", 單號_tb.Text, Strings.Format(支付日期_dtp.Value, "yyyy/MM/dd"))
  452. End If
  453. End Sub
  454. Private Sub 單據作廢_bt_Click(sender As Object, e As EventArgs) Handles 單據作廢_bt.Click
  455. If 系統單號_bt.Text = "" Then : MGB(對話框(3), 1) : 首次開啟 = False : Else : INB(對話框(6)) : PA = 訊息回應
  456. If PA = "" Then : MGB(對話框(7), 1) : Else : Set_日期格式轉換()
  457. PA42 = 系統單號_bt.Text : SQL_營運成本收支單審核_審核人3() : conn.Close() : MGB(對話框(5), 1) : PA = "" : 首次開啟 = False : Set_清單1()
  458. End If
  459. End If
  460. End Sub
  461. Private Sub 申請金額_nud_ValueChanged(sender As Object, e As EventArgs) Handles 申請金額_nud.ValueChanged
  462. 大寫轉換()
  463. End Sub
  464. Private Sub 大寫轉換()
  465. Dim 個位(20), 十位(9), 百位(1), 千位(1), 百萬, 十億, 零, 拾, 百, 仟, 萬, 億, 兆, 答案 As String : Dim 數長 As Integer
  466. If 系統語言 = "繁體中文" Then
  467. 個位(0) = "零" : 個位(1) = "壹" : 個位(2) = "貳" : 個位(3) = "參" : 個位(4) = "肆" : 個位(5) = "伍" : 個位(6) = "陸" : 個位(7) = "柒" : 個位(8) = "捌" : 個位(9) = "玖"
  468. 零 = "零" : 拾 = "拾" : 百 = "百" : 仟 = "仟" : 萬 = "萬" : 億 = "億" : 兆 = "兆"
  469. ElseIf 系統語言 = "Indonesian" Then
  470. 個位(0) = "Nol" : 個位(1) = "Satu" : 個位(2) = "Dua" : 個位(3) = "Tiga" : 個位(4) = "Empat" : 個位(5) = "Lima" : 個位(6) = "Enam" : 個位(7) = "Tujuh"
  471. 個位(8) = "Delapan" : 個位(9) = "Sembilan" : 個位(10) = "Sepuluh" : 個位(11) = "Sebelas" : 個位(12) = "Dua Belas" : 個位(13) = "Tiga Belas" : 個位(14) = "Empat Belas"
  472. 個位(15) = "Lima Belas" : 個位(16) = "Enam Belas" : 個位(17) = "Tujuh Belas" : 個位(18) = "Delapan Belas" : 個位(19) = "Sembilan Belas" : 個位(20) = "Dua Puluh"
  473. 十位(1) = "Sepuluh" : 十位(2) = "Dua Puluh" : 十位(3) = "Tiga Puluh" : 十位(4) = "Empat Puluh" : 十位(5) = "Lima Puluh" : 十位(6) = "Enam Puluh" : 十位(7) = "Tujuh Puluh"
  474. 十位(8) = "Delapan Puluh" : 十位(9) = "Sembilan Puluh"
  475. 百位(0) = "Seratus" : 百位(1) = "Ratus" : 千位(0) = "Seribu" : 千位(1) = "Ribu" : 百萬 = "Juta" : 十億 = "Miliar" : 兆 = "Triliun"
  476. ElseIf 系統語言 = "English" Then
  477. 個位(0) = "Zero" : 個位(1) = "One" : 個位(2) = "Two" : 個位(3) = "Three" : 個位(4) = "Four" : 個位(5) = "Five" : 個位(6) = "Six" : 個位(7) = "Seven"
  478. 個位(8) = "Eight" : 個位(9) = "Nine" : 個位(10) = "Ten" : 個位(11) = "Eleven" : 個位(12) = "Twelve" : 個位(13) = "Thirteen" : 個位(14) = "Fourteen"
  479. 個位(15) = "Fifteen" : 個位(16) = "Sixteen" : 個位(17) = "Seventeen" : 個位(18) = "Eighteen" : 個位(19) = "Nineteen" : 個位(20) = "Twenty"
  480. 十位(1) = "Ten" : 十位(2) = "Twenty" : 十位(3) = "Thirty" : 十位(4) = "Forty" : 十位(5) = "Fifty" : 十位(6) = "Sixty" : 十位(7) = "Seventy" : 十位(8) = "Eighty"
  481. 十位(9) = "Ninety"
  482. 百位(0) = "One Hundred" : 百位(1) = "Hundred" : 千位(0) = "One Thousand" : 千位(1) = "Thousand" : 百萬 = "Million" : 十億 = "Billion" : 兆 = "Trillion"
  483. End If
  484. '--------------轉大寫-----------------------------------------------------------
  485. Dim 位數(13), 末位數 As String
  486. Dim NB As Long = 申請金額_nud.Value : Dim NBS As String = NB.ToString() : 數長 = NBS.Length
  487. 位數(1) = Strings.Left(NBS, 1) : 末位數 = Strings.Right(NBS, 1)
  488. If 數長 >= 2 Then : 位數(2) = Strings.Mid(NBS, 2, 1) : End If : If 數長 >= 3 Then : 位數(3) = Strings.Mid(NBS, 3, 1) : End If
  489. If 數長 >= 4 Then : 位數(4) = Strings.Mid(NBS, 4, 1) : End If : If 數長 >= 5 Then : 位數(5) = Strings.Mid(NBS, 5, 1) : End If
  490. If 數長 >= 6 Then : 位數(6) = Strings.Mid(NBS, 6, 1) : End If : If 數長 >= 7 Then : 位數(7) = Strings.Mid(NBS, 7, 1) : End If
  491. If 數長 >= 8 Then : 位數(8) = Strings.Mid(NBS, 8, 1) : End If : If 數長 >= 9 Then : 位數(9) = Strings.Mid(NBS, 9, 1) : End If
  492. If 數長 >= 10 Then : 位數(10) = Strings.Mid(NBS, 10, 1) : End If : If 數長 >= 11 Then : 位數(11) = Strings.Mid(NBS, 11, 1) : End If
  493. If 數長 >= 12 Then : 位數(12) = Strings.Mid(NBS, 12, 1) : End If : If 數長 >= 13 Then : 位數(13) = Strings.Mid(NBS, 13, 1) : End If
  494. If 系統語言 <> "繁體中文" Then
  495. If 申請金額_nud.Value < 21 Then : 答案 = 個位(申請金額_nud.Value)
  496. ElseIf 數長 = 2 Then
  497. If 位數(2) <> "0" And 末位數 = "0" Then : 答案 = 十位(位數(1))
  498. ElseIf 位數(2) <> "0" And 末位數 <> "0" Then : 答案 = 十位(位數(1)) & " " & 個位(末位數) : End If
  499. ElseIf 數長 = 3 Then
  500. '------------------百------------------------------------------------------------------------------------------------------
  501. If 位數(1) = "1" Then : 答案 = 百位(0) : ElseIf 位數(1) <> "1" Then : 答案 = 個位(位數(1)) & " " & 百位(1) : End If
  502. '------------------個十------------------------------------------------------------------------------------------------------
  503. If 位數(2) = "0" And 末位數 = "0" Then
  504. ElseIf 位數(2) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  505. Else
  506. If CInt(位數(2) & 末位數) < 21 Then
  507. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(2)) : Else : 答案 &= " " & 個位(位數(2) & 末位數) : End If
  508. Else
  509. If 位數(2) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(2))
  510. ElseIf 位數(2) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 個位(末位數) : End If
  511. End If
  512. End If
  513. ElseIf 數長 = 4 Then
  514. '------------------千------------------------------------------------------------------------------------------------------
  515. If 位數(1) = "1" Then : 答案 = 千位(0)
  516. ElseIf 位數(1) <> "1" Then : 答案 = 個位(位數(1)) & " " & 千位(1) : End If
  517. '------------------百------------------------------------------------------------------------------------------------------
  518. If CInt(位數(2) & 位數(3) & 末位數) < 100 Then
  519. ElseIf CInt(位數(2) & 位數(3) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  520. ElseIf CInt(位數(2) & 位數(3) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(2)) & " " & 百位(1) : End If
  521. '------------------個十------------------------------------------------------------------------------------------------------
  522. If 位數(3) = "0" And 末位數 = "0" Then
  523. ElseIf 位數(3) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  524. Else
  525. If CInt(位數(3) & 末位數) < 21 Then
  526. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(3)) : Else : 答案 &= " " & 個位(位數(3) & 末位數) : End If
  527. Else
  528. If 位數(3) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(3))
  529. ElseIf 位數(3) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 個位(末位數) : End If
  530. End If
  531. End If
  532. ElseIf 數長 = 5 Then
  533. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  534. If CInt(位數(1) & 位數(2)) < 21 Then
  535. If 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 千位(1) : Else : 答案 = 個位(位數(1) & 位數(2)) & " " & 千位(1) : End If
  536. Else
  537. If 位數(1) <> "0" And 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 千位(1)
  538. ElseIf 位數(1) <> "0" And 位數(2) <> "0" Then : 答案 = 十位(位數(1)) & " " & 個位(位數(2)) & " " & 千位(1) : End If
  539. End If
  540. '------------------百------------------------------------------------------------------------------------------------------
  541. If CInt(位數(3) & 位數(4) & 末位數) < 100 Then
  542. ElseIf CInt(位數(3) & 位數(4) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  543. ElseIf CInt(位數(3) & 位數(4) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(3)) & " " & 百位(1) : End If
  544. '------------------個十------------------------------------------------------------------------------------------------------
  545. If 位數(4) = "0" And 末位數 = "0" Then
  546. ElseIf 位數(4) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  547. Else
  548. If CInt(位數(4) & 末位數) < 21 Then
  549. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(4)) : Else : 答案 &= " " & 個位(位數(4) & 末位數) : End If
  550. Else
  551. If 位數(4) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(4))
  552. ElseIf 位數(4) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 個位(末位數) : End If
  553. End If
  554. End If
  555. ElseIf 數長 = 6 Then
  556. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  557. If CInt(位數(1)) = 1 Then : 答案 = 百位(0) : Else : 答案 = 個位(位數(1)) & " " & 百位(1) : End If
  558. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  559. If CInt(位數(2) & 位數(3)) < 21 Then
  560. If 位數(3) = "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 千位(1) : Else : 答案 &= " " & 個位(位數(2) & 位數(3)) & " " & 千位(1) : End If
  561. Else
  562. If 位數(2) <> "0" And 位數(3) = "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 千位(1)
  563. ElseIf 位數(2) <> "0" And 位數(3) <> "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 個位(位數(3)) & " " & 千位(1) : End If
  564. End If
  565. '------------------百------------------------------------------------------------------------------------------------------
  566. If CInt(位數(4) & 位數(5) & 末位數) < 100 Then
  567. ElseIf CInt(位數(4) & 位數(5) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  568. ElseIf CInt(位數(4) & 位數(5) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(4)) & " " & 百位(1) : End If
  569. '------------------個十------------------------------------------------------------------------------------------------------
  570. If 位數(5) = "0" And 末位數 = "0" Then
  571. ElseIf 位數(5) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  572. Else
  573. If CInt(位數(5) & 末位數) < 21 Then
  574. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(5)) : Else : 答案 &= " " & 個位(位數(5) & 末位數) : End If
  575. Else
  576. If 位數(5) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(5))
  577. ElseIf 位數(5) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(5)) & " " & 個位(末位數) : End If
  578. End If
  579. End If
  580. ElseIf 數長 = 7 Then
  581. '------------------百萬------------------------------------------------------------------------------------------------------
  582. 答案 = 個位(位數(1)) & " " & 百萬
  583. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  584. If CInt(位數(2)) = 0 Then : ElseIf CInt(位數(2)) = 1 Then : 答案 &= " " & 百位(0)
  585. ElseIf CInt(位數(2)) > 1 Then : 答案 &= " " & 個位(位數(2)) & " " & 百位(1) : End If
  586. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  587. If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" Then : Else
  588. If CInt(位數(3) & 位數(4)) < 21 Then
  589. If 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= " " & 千位(1)
  590. ElseIf 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= " " & 個位(位數(4)) & " " & 千位(1)
  591. ElseIf 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 千位(1)
  592. ElseIf 位數(3) <> "0" And 位數(4) <> "0" Then : 答案 &= " " & 個位(位數(3) & 位數(4)) & " " & 千位(1) : End If
  593. Else
  594. If 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 千位(1)
  595. ElseIf 位數(3) <> "0" And 位數(4) <> "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 個位(位數(4)) & " " & 千位(1) : End If
  596. End If
  597. End If
  598. '------------------百------------------------------------------------------------------------------------------------------
  599. If CInt(位數(5) & 位數(6) & 末位數) < 100 Then
  600. ElseIf CInt(位數(5) & 位數(6) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  601. ElseIf CInt(位數(5) & 位數(6) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(5)) & " " & 百位(1) : End If
  602. '------------------個十------------------------------------------------------------------------------------------------------
  603. If 位數(6) = "0" And 末位數 = "0" Then
  604. ElseIf 位數(6) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  605. Else
  606. If CInt(位數(6) & 末位數) < 21 Then
  607. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(6)) : Else : 答案 &= " " & 個位(位數(6) & 末位數) : End If
  608. Else
  609. If 位數(6) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(6))
  610. ElseIf 位數(6) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(6)) & " " & 個位(末位數) : End If
  611. End If
  612. End If
  613. ElseIf 數長 = 8 Then
  614. '------------------十百萬(千萬)------------------------------------------------------------------------------------------------------
  615. If CInt(位數(1) & 位數(2)) < 21 Then
  616. If 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 百萬 : Else : 答案 = 個位(位數(1) & 位數(2)) & " " & 百萬 : End If
  617. Else
  618. If 位數(1) <> "0" And 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 百萬
  619. ElseIf 位數(1) <> "0" And 位數(2) <> "0" Then : 答案 = 十位(位數(1)) & " " & 個位(位數(2)) & " " & 百萬 : End If
  620. End If
  621. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  622. If CInt(位數(3)) = 0 Then : ElseIf CInt(位數(3)) = 1 Then : 答案 &= " " & 百位(0)
  623. ElseIf CInt(位數(3)) > 1 Then : 答案 &= " " & 個位(位數(3)) & " " & 百位(1) : End If
  624. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  625. If 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" Then : Else
  626. If CInt(位數(4) & 位數(5)) < 21 Then
  627. If 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= " " & 千位(1)
  628. ElseIf 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= " " & 個位(位數(5)) & " " & 千位(1)
  629. ElseIf 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 千位(1)
  630. ElseIf 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= " " & 個位(位數(4) & 位數(5)) & " " & 千位(1) : End If
  631. Else
  632. If 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 千位(1)
  633. ElseIf 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 個位(位數(5)) & " " & 千位(1) : End If
  634. End If
  635. End If
  636. '------------------百------------------------------------------------------------------------------------------------------
  637. If CInt(位數(6) & 位數(7) & 末位數) < 100 Then
  638. ElseIf CInt(位數(6) & 位數(7) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  639. ElseIf CInt(位數(6) & 位數(7) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(6)) & " " & 百位(1) : End If
  640. '------------------個十------------------------------------------------------------------------------------------------------
  641. If 位數(7) = "0" And 末位數 = "0" Then
  642. ElseIf 位數(7) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  643. Else
  644. If CInt(位數(7) & 末位數) < 21 Then
  645. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(7)) : Else : 答案 &= " " & 個位(位數(7) & 末位數) : End If
  646. Else
  647. If 位數(7) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(7))
  648. ElseIf 位數(7) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(7)) & " " & 個位(末位數) : End If
  649. End If
  650. End If
  651. ElseIf 數長 = 9 Then
  652. '------------------百百萬(億)------------------------------------------------------------------------------------------------------
  653. If CInt(位數(1)) = 1 Then : 答案 = 百位(0) : ElseIf CInt(位數(1)) > 1 Then : 答案 = 個位(位數(1)) & " " & 百位(1) : End If
  654. '------------------十百萬(千萬)------------------------------------------------------------------------------------------------------
  655. If 位數(2) = "0" And 位數(3) = "0" Then : 答案 &= " " & 百萬
  656. ElseIf 位數(2) = "0" And 位數(3) <> "0" Then : 答案 &= " " & 個位(位數(3)) & " " & 百萬
  657. ElseIf CInt(位數(2) & 位數(3)) < 21 Then
  658. If 位數(3) = "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 百萬 : Else : 答案 &= " " & 個位(位數(2) & 位數(3)) & " " & 百萬 : End If
  659. ElseIf CInt(位數(2) & 位數(3)) >= 21 Then
  660. If 位數(2) <> "0" And 位數(3) = "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 百萬
  661. ElseIf 位數(2) <> "0" And 位數(3) <> "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 個位(位數(3)) & " " & 百萬 : End If
  662. End If
  663. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  664. If CInt(位數(4)) = 0 Then : ElseIf CInt(位數(4)) = 1 Then : 答案 &= " " & 百位(0)
  665. ElseIf CInt(位數(4)) > 1 Then : 答案 &= " " & 個位(位數(4)) & " " & 百位(1) : End If
  666. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  667. If 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" Then : Else
  668. If CInt(位數(5) & 位數(6)) < 21 Then
  669. If 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= " " & 千位(1)
  670. ElseIf 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= " " & 個位(位數(6)) & " " & 千位(1)
  671. ElseIf 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= " " & 十位(位數(5)) & " " & 千位(1)
  672. ElseIf 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= " " & 個位(位數(5) & 位數(6)) & " " & 千位(1) : End If
  673. Else
  674. If 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= " " & 十位(位數(5)) & " " & 千位(1)
  675. ElseIf 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= " " & 十位(位數(5)) & " " & 個位(位數(6)) & " " & 千位(1) : End If
  676. End If
  677. End If
  678. '------------------百------------------------------------------------------------------------------------------------------
  679. If CInt(位數(7) & 位數(8) & 末位數) < 100 Then
  680. ElseIf CInt(位數(7) & 位數(8) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  681. ElseIf CInt(位數(7) & 位數(8) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(7)) & " " & 百位(1) : End If
  682. '------------------個十------------------------------------------------------------------------------------------------------
  683. If 位數(8) = "0" And 末位數 = "0" Then
  684. ElseIf 位數(8) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  685. Else
  686. If CInt(位數(8) & 末位數) < 21 Then
  687. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(8)) : Else : 答案 &= " " & 個位(位數(8) & 末位數) : End If
  688. Else
  689. If 位數(8) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(8))
  690. ElseIf 位數(8) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(8)) & " " & 個位(末位數) : End If
  691. End If
  692. End If
  693. ElseIf 數長 = 10 Then
  694. '------------------十億------------------------------------------------------------------------------------------------------
  695. 答案 = 個位(位數(1)) & " " & 十億
  696. '------------------百百萬(億)------------------------------------------------------------------------------------------------------
  697. If CInt(位數(2)) = 0 Then
  698. ElseIf CInt(位數(2)) = 1 Then : 答案 &= " " & 百位(0)
  699. ElseIf CInt(位數(2)) > 1 Then : 答案 &= " " & 個位(位數(2)) & " " & 百位(1) : End If
  700. '------------------十百萬(千萬)------------------------------------------------------------------------------------------------------
  701. If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" Then
  702. ElseIf 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= " " & 百萬
  703. ElseIf 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= " " & 個位(位數(4)) & " " & 百萬
  704. ElseIf CInt(位數(3) & 位數(4)) < 21 Then
  705. If 位數(4) = "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 百萬 : Else : 答案 &= " " & 個位(位數(3) & 位數(4)) & " " & 百萬 : End If
  706. ElseIf CInt(位數(3) & 位數(4)) >= 21 Then
  707. If 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 百萬
  708. ElseIf 位數(3) <> "0" And 位數(4) <> "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 個位(位數(4)) & " " & 百萬 : End If
  709. End If
  710. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  711. If CInt(位數(5)) = 0 Then : ElseIf CInt(位數(5)) = 1 Then : 答案 &= " " & 百位(0)
  712. ElseIf CInt(位數(5)) > 1 Then : 答案 &= " " & 個位(位數(5)) & " " & 百位(1) : End If
  713. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  714. If CInt(位數(6) & 位數(7)) < 21 Then
  715. If 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" Then
  716. ElseIf 位數(6) = "0" And 位數(7) = "0" Then : 答案 &= " " & 千位(1)
  717. ElseIf 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= " " & 個位(位數(7)) & " " & 千位(1)
  718. ElseIf 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= " " & 十位(位數(6)) & " " & 千位(1)
  719. ElseIf 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= " " & 個位(位數(6) & 位數(7)) & " " & 千位(1) : End If
  720. Else
  721. If 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= " " & 十位(位數(6)) & " " & 千位(1)
  722. ElseIf 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= " " & 十位(位數(6)) & " " & 個位(位數(7)) & " " & 千位(1) : End If
  723. End If
  724. '------------------百------------------------------------------------------------------------------------------------------
  725. If CInt(位數(8) & 位數(9) & 末位數) < 100 Then
  726. ElseIf CInt(位數(8) & 位數(9) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  727. ElseIf CInt(位數(8) & 位數(9) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(8)) & " " & 百位(1) : End If
  728. '------------------個十------------------------------------------------------------------------------------------------------
  729. If 位數(9) = "0" And 末位數 = "0" Then
  730. ElseIf 位數(9) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  731. Else
  732. If CInt(位數(9) & 末位數) < 21 Then
  733. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(9)) : Else : 答案 &= " " & 個位(位數(9) & 末位數) : End If
  734. Else
  735. If 位數(9) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(9))
  736. ElseIf 位數(9) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(9)) & " " & 個位(末位數) : End If
  737. End If
  738. End If
  739. ElseIf 數長 = 11 Then
  740. '------------------十十億(百億)------------------------------------------------------------------------------------------------------
  741. If CInt(位數(1) & 位數(2)) < 21 Then
  742. If 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 十億 : Else : 答案 = 個位(位數(1) & 位數(2)) & " " & 十億 : End If
  743. Else
  744. If 位數(1) <> "0" And 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 十億
  745. ElseIf 位數(1) <> "0" And 位數(2) <> "0" Then : 答案 = 十位(位數(1)) & " " & 個位(位數(2)) & " " & 十億 : End If
  746. End If
  747. '------------------百百萬(億)------------------------------------------------------------------------------------------------------
  748. If CInt(位數(3)) = 0 Then
  749. ElseIf CInt(位數(3)) = 1 Then : 答案 &= " " & 百位(0)
  750. ElseIf CInt(位數(3)) > 1 Then : 答案 &= " " & 個位(位數(3)) & " " & 百位(1) : End If
  751. '------------------十百萬(千萬)------------------------------------------------------------------------------------------------------
  752. If 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" Then
  753. ElseIf 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= " " & 百萬
  754. ElseIf 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= " " & 個位(位數(5)) & " " & 百萬
  755. ElseIf CInt(位數(4) & 位數(5)) < 21 Then
  756. If 位數(5) = "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 百萬 : Else : 答案 &= " " & 個位(位數(4) & 位數(5)) & " " & 百萬 : End If
  757. ElseIf CInt(位數(4) & 位數(5)) >= 21 Then
  758. If 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 百萬
  759. ElseIf 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 個位(位數(5)) & " " & 百萬 : End If
  760. End If
  761. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  762. If CInt(位數(6)) = 0 Then : ElseIf CInt(位數(6)) = 1 Then : 答案 &= " " & 百位(0)
  763. ElseIf CInt(位數(6)) > 1 Then : 答案 &= " " & 個位(位數(6)) & " " & 百位(1) : End If
  764. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  765. If CInt(位數(7) & 位數(8)) < 21 Then
  766. If 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" Then
  767. ElseIf 位數(7) = "0" And 位數(8) = "0" Then : 答案 &= " " & 千位(1)
  768. ElseIf 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= " " & 個位(位數(8)) & " " & 千位(1)
  769. ElseIf 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= " " & 十位(位數(7)) & " " & 千位(1)
  770. ElseIf 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= " " & 個位(位數(7) & 位數(8)) & " " & 千位(1) : End If
  771. Else
  772. If 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= " " & 十位(位數(7)) & " " & 千位(1)
  773. ElseIf 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= " " & 十位(位數(7)) & " " & 個位(位數(8)) & " " & 千位(1) : End If
  774. End If
  775. '------------------百------------------------------------------------------------------------------------------------------
  776. If CInt(位數(9) & 位數(10) & 末位數) < 100 Then
  777. ElseIf CInt(位數(9) & 位數(10) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  778. ElseIf CInt(位數(9) & 位數(10) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(9)) & " " & 百位(1) : End If
  779. '------------------個十------------------------------------------------------------------------------------------------------
  780. If 位數(10) = "0" And 末位數 = "0" Then
  781. ElseIf 位數(10) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  782. Else
  783. If CInt(位數(10) & 末位數) < 21 Then
  784. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(10)) : Else : 答案 &= " " & 個位(位數(10) & 末位數) : End If
  785. Else
  786. If 位數(10) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(10))
  787. ElseIf 位數(10) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(10)) & " " & 個位(末位數) : End If
  788. End If
  789. End If
  790. ElseIf 數長 = 12 Then
  791. '------------------百(千億)------------------------------------------------------------------------------------------------------
  792. If 位數(1) = "1" Then : 答案 = 百位(0) : ElseIf 位數(1) <> "1" Then : 答案 = 個位(位數(1)) & " " & 百位(1) : End If
  793. '------------------十十億(百億)------------------------------------------------------------------------------------------------------
  794. If 位數(2) = "0" And 位數(3) = "0" Then : 答案 &= " " & 十億
  795. ElseIf CInt(位數(2) & 位數(3)) < 21 Then
  796. If 位數(3) = "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 十億 : Else : 答案 &= " " & 個位(位數(2) & 位數(3)) & " " & 十億 : End If
  797. Else
  798. If 位數(2) <> "0" And 位數(3) = "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 十億
  799. ElseIf 位數(2) <> "0" And 位數(3) <> "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 個位(位數(3)) & " " & 十億 : End If
  800. End If
  801. '------------------百百萬(億)------------------------------------------------------------------------------------------------------
  802. If CInt(位數(4)) = 0 Then
  803. ElseIf CInt(位數(4)) = 1 Then : 答案 &= " " & 百位(0)
  804. ElseIf CInt(位數(4)) > 1 Then : 答案 &= " " & 個位(位數(4)) & " " & 百位(1) : End If
  805. '------------------十百萬(千萬)------------------------------------------------------------------------------------------------------
  806. If 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" Then
  807. ElseIf 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= " " & 百萬
  808. ElseIf 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= " " & 個位(位數(6)) & " " & 百萬
  809. ElseIf CInt(位數(5) & 位數(6)) < 21 Then
  810. If 位數(6) = "0" Then : 答案 &= " " & 十位(位數(5)) & " " & 百萬 : Else : 答案 &= " " & 個位(位數(5) & 位數(6)) & " " & 百萬 : End If
  811. ElseIf CInt(位數(5) & 位數(6)) >= 21 Then
  812. If 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= " " & 十位(位數(5)) & " " & 百萬
  813. ElseIf 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= " " & 十位(位數(5)) & " " & 個位(位數(6)) & " " & 百萬 : End If
  814. End If
  815. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  816. If CInt(位數(7)) = 0 Then : ElseIf CInt(位數(7)) = 1 Then : 答案 &= " " & 百位(0)
  817. ElseIf CInt(位數(7)) > 1 Then : 答案 &= " " & 個位(位數(7)) & " " & 百位(1) : End If
  818. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  819. If CInt(位數(8) & 位數(9)) < 21 Then
  820. If 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" Then
  821. ElseIf 位數(8) = "0" And 位數(9) = "0" Then : 答案 &= " " & 千位(1)
  822. ElseIf 位數(8) = "0" And 位數(9) <> "0" Then : 答案 &= " " & 個位(位數(9)) & " " & 千位(1)
  823. ElseIf 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= " " & 十位(位數(8)) & " " & 千位(1)
  824. ElseIf 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= " " & 個位(位數(8) & 位數(9)) & " " & 千位(1) : End If
  825. Else
  826. If 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= " " & 十位(位數(8)) & " " & 千位(1)
  827. ElseIf 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= " " & 十位(位數(8)) & " " & 個位(位數(9)) & " " & 千位(1) : End If
  828. End If
  829. '------------------百------------------------------------------------------------------------------------------------------
  830. If CInt(位數(10) & 位數(11) & 末位數) < 100 Then
  831. ElseIf CInt(位數(10) & 位數(11) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  832. ElseIf CInt(位數(10) & 位數(11) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(10)) & " " & 百位(1) : End If
  833. '------------------個十------------------------------------------------------------------------------------------------------
  834. If 位數(11) = "0" And 末位數 = "0" Then
  835. ElseIf 位數(11) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  836. Else
  837. If CInt(位數(11) & 末位數) < 21 Then
  838. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(11)) : Else : 答案 &= " " & 個位(位數(11) & 末位數) : End If
  839. Else
  840. If 位數(11) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(11))
  841. ElseIf 位數(11) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(11)) & " " & 個位(末位數) : End If
  842. End If
  843. End If
  844. ElseIf 數長 = 13 Then
  845. '------------------兆------------------------------------------------------------------------------------------------------
  846. 答案 = 個位(位數(1)) & " " & 兆
  847. '------------------百(千億)------------------------------------------------------------------------------------------------------
  848. If 位數(2) = "0" Then
  849. ElseIf 位數(2) = "1" Then : 答案 &= " " & 百位(0)
  850. ElseIf 位數(2) <> "1" Then : 答案 &= " " & 個位(位數(2)) & " " & 百位(1) : End If
  851. '------------------十十億(百億)------------------------------------------------------------------------------------------------------
  852. If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" Then
  853. ElseIf 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= " " & 十億
  854. ElseIf CInt(位數(3) & 位數(4)) < 21 Then
  855. If 位數(4) = "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 十億 : Else : 答案 &= " " & 個位(位數(3) & 位數(4)) & " " & 十億 : End If
  856. Else
  857. If 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 十億
  858. ElseIf 位數(3) <> "0" And 位數(4) <> "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 個位(位數(4)) & " " & 十億 : End If
  859. End If
  860. '------------------百百萬(億)------------------------------------------------------------------------------------------------------
  861. If CInt(位數(5)) = 0 Then
  862. ElseIf CInt(位數(5)) = 1 Then : 答案 &= " " & 百位(0)
  863. ElseIf CInt(位數(5)) > 1 Then : 答案 &= " " & 個位(位數(5)) & " " & 百位(1) : End If
  864. '------------------十百萬(千萬)------------------------------------------------------------------------------------------------------
  865. If 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" Then
  866. ElseIf 位數(6) = "0" And 位數(7) = "0" Then : 答案 &= " " & 百萬
  867. ElseIf 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= " " & 個位(位數(7)) & " " & 百萬
  868. ElseIf CInt(位數(6) & 位數(7)) < 21 Then
  869. If 位數(7) = "0" Then : 答案 &= " " & 十位(位數(6)) & " " & 百萬 : Else : 答案 &= " " & 個位(位數(6) & 位數(7)) & " " & 百萬 : End If
  870. ElseIf CInt(位數(6) & 位數(7)) >= 21 Then
  871. If 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= " " & 十位(位數(6)) & " " & 百萬
  872. ElseIf 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= " " & 十位(位數(6)) & " " & 個位(位數(7)) & " " & 百萬 : End If
  873. End If
  874. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  875. If CInt(位數(8)) = 0 Then : ElseIf CInt(位數(8)) = 1 Then : 答案 &= " " & 百位(0)
  876. ElseIf CInt(位數(8)) > 1 Then : 答案 &= " " & 個位(位數(8)) & " " & 百位(1) : End If
  877. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  878. If CInt(位數(9) & 位數(10)) < 21 Then
  879. If 位數(8) = "0" And 位數(9) = "0" And 位數(10) = "0" Then
  880. ElseIf 位數(9) = "0" And 位數(10) = "0" Then : 答案 &= " " & 千位(1)
  881. ElseIf 位數(9) = "0" And 位數(10) <> "0" Then : 答案 &= " " & 個位(位數(10)) & " " & 千位(1)
  882. ElseIf 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= " " & 十位(位數(9)) & " " & 千位(1)
  883. ElseIf 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= " " & 個位(位數(9) & 位數(10)) & " " & 千位(1) : End If
  884. Else
  885. If 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= " " & 十位(位數(9)) & " " & 千位(1)
  886. ElseIf 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= " " & 十位(位數(9)) & " " & 個位(位數(10)) & " " & 千位(1) : End If
  887. End If
  888. '------------------百------------------------------------------------------------------------------------------------------
  889. If CInt(位數(11) & 位數(12) & 末位數) < 100 Then
  890. ElseIf CInt(位數(11) & 位數(12) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  891. ElseIf CInt(位數(11) & 位數(12) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(11)) & " " & 百位(1) : End If
  892. '------------------個十------------------------------------------------------------------------------------------------------
  893. If 位數(12) = "0" And 末位數 = "0" Then
  894. ElseIf 位數(12) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  895. Else
  896. If CInt(位數(12) & 末位數) < 21 Then
  897. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(12)) : Else : 答案 &= " " & 個位(位數(12) & 末位數) : End If
  898. Else
  899. If 位數(12) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(12))
  900. ElseIf 位數(12) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(12)) & " " & 個位(末位數) : End If
  901. End If
  902. End If
  903. ElseIf 數長 = 14 Then
  904. '------------------十兆------------------------------------------------------------------------------------------------------
  905. If CInt(位數(1) & 位數(2)) < 21 Then
  906. If 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 兆 : Else : 答案 = 個位(位數(1) & 位數(2)) & " " & 兆 : End If
  907. Else
  908. If 位數(1) <> "0" And 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 兆
  909. ElseIf 位數(1) <> "0" And 位數(2) <> "0" Then : 答案 = 十位(位數(1)) & " " & 個位(位數(2)) & " " & 兆 : End If
  910. End If
  911. '------------------百(千億)------------------------------------------------------------------------------------------------------
  912. If 位數(3) = "0" Then
  913. ElseIf 位數(3) = "1" Then : 答案 &= " " & 百位(0)
  914. ElseIf 位數(3) <> "1" Then : 答案 &= " " & 個位(位數(3)) & " " & 百位(1) : End If
  915. '------------------十十億(百億)------------------------------------------------------------------------------------------------------
  916. If 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" Then
  917. ElseIf 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= " " & 十億
  918. ElseIf CInt(位數(4) & 位數(5)) < 21 Then
  919. If 位數(5) = "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 十億 : Else : 答案 &= " " & 個位(位數(4) & 位數(5)) & " " & 十億 : End If
  920. Else
  921. If 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 十億
  922. ElseIf 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 個位(位數(5)) & " " & 十億 : End If
  923. End If
  924. '------------------百百萬(億)------------------------------------------------------------------------------------------------------
  925. If CInt(位數(6)) = 0 Then
  926. ElseIf CInt(位數(6)) = 1 Then : 答案 &= " " & 百位(0)
  927. ElseIf CInt(位數(6)) > 1 Then : 答案 &= " " & 個位(位數(6)) & " " & 百位(1) : End If
  928. '------------------十百萬(千萬)------------------------------------------------------------------------------------------------------
  929. If 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" Then
  930. ElseIf 位數(7) = "0" And 位數(8) = "0" Then : 答案 &= " " & 百萬
  931. ElseIf 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= " " & 個位(位數(8)) & " " & 百萬
  932. ElseIf CInt(位數(7) & 位數(8)) < 21 Then
  933. If 位數(8) = "0" Then : 答案 &= " " & 十位(位數(7)) & " " & 百萬 : Else : 答案 &= " " & 個位(位數(7) & 位數(8)) & " " & 百萬 : End If
  934. ElseIf CInt(位數(7) & 位數(8)) >= 21 Then
  935. If 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= " " & 十位(位數(7)) & " " & 百萬
  936. ElseIf 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= " " & 十位(位數(7)) & " " & 個位(位數(8)) & " " & 百萬 : End If
  937. End If
  938. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  939. If CInt(位數(9)) = 0 Then : ElseIf CInt(位數(9)) = 1 Then : 答案 &= " " & 百位(0)
  940. ElseIf CInt(位數(9)) > 1 Then : 答案 &= " " & 個位(位數(9)) & " " & 百位(1) : End If
  941. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  942. If CInt(位數(10) & 位數(11)) < 21 Then
  943. If 位數(9) = "0" And 位數(10) = "0" And 位數(11) = "0" Then
  944. ElseIf 位數(10) = "0" And 位數(11) = "0" Then : 答案 &= " " & 千位(1)
  945. ElseIf 位數(10) = "0" And 位數(11) <> "0" Then : 答案 &= " " & 個位(位數(11)) & " " & 千位(1)
  946. ElseIf 位數(10) <> "0" And 位數(11) = "0" Then : 答案 &= " " & 十位(位數(10)) & " " & 千位(1)
  947. ElseIf 位數(10) <> "0" And 位數(11) <> "0" Then : 答案 &= " " & 個位(位數(10) & 位數(11)) & " " & 千位(1) : End If
  948. Else
  949. If 位數(10) <> "0" And 位數(11) = "0" Then : 答案 &= " " & 十位(位數(10)) & " " & 千位(1)
  950. ElseIf 位數(10) <> "0" And 位數(11) <> "0" Then : 答案 &= " " & 十位(位數(10)) & " " & 個位(位數(11)) & " " & 千位(1) : End If
  951. End If
  952. '------------------百------------------------------------------------------------------------------------------------------
  953. If CInt(位數(12) & 位數(13) & 末位數) < 100 Then
  954. ElseIf CInt(位數(12) & 位數(13) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  955. ElseIf CInt(位數(12) & 位數(13) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(12)) & " " & 百位(1) : End If
  956. '------------------個十------------------------------------------------------------------------------------------------------
  957. If 位數(13) = "0" And 末位數 = "0" Then
  958. ElseIf 位數(13) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  959. Else
  960. If CInt(位數(13) & 末位數) < 21 Then
  961. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(13)) : Else : 答案 &= " " & 個位(位數(13) & 末位數) : End If
  962. Else
  963. If 位數(13) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(13))
  964. ElseIf 位數(13) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(13)) & " " & 個位(末位數)
  965. End If
  966. End If
  967. End If
  968. End If
  969. Else
  970. If 數長 = 1 Then : 答案 = 個位(申請金額_nud.Value)
  971. ElseIf 數長 = 2 Then
  972. If 末位數 = "0" Then : 答案 = 個位(位數(1)) & 拾 : Else : 答案 = 個位(位數(1)) & 拾 & 個位(末位數) : End If
  973. ElseIf 數長 = 3 Then : 答案 = 個位(位數(1)) & 百
  974. If 位數(2) = "0" And 末位數 = "0" Then
  975. ElseIf 位數(2) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  976. ElseIf 位數(2) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 拾
  977. ElseIf 位數(2) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 拾 & 個位(末位數)
  978. End If
  979. ElseIf 數長 = 4 Then : 答案 = 個位(位數(1)) & 仟
  980. If 位數(2) = "0" And 位數(3) = "0" And 末位數 = "0" Then
  981. ElseIf 位數(2) = "0" And 位數(3) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  982. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾 & 個位(末位數)
  983. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾
  984. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 百
  985. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 零 & 個位(末位數)
  986. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾
  987. ElseIf 位數(2) <> "0" And 末位數 <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾 & 個位(末位數)
  988. End If
  989. ElseIf 數長 = 5 Then : 答案 = 個位(位數(1)) & 萬
  990. If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" And 末位數 = "0" Then
  991. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  992. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾
  993. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾 & 個位(末位數)
  994. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(3)) & 百
  995. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 零 & 個位(末位數)
  996. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾
  997. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 個位(末位數)
  998. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 仟
  999. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(末位數)
  1000. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(位數(4)) & 拾
  1001. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(位數(4)) & 拾 & 個位(末位數)
  1002. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百
  1003. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 零 & 個位(末位數)
  1004. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾
  1005. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 個位(末位數)
  1006. End If
  1007. ElseIf 數長 = 6 Then
  1008. If 位數(2) = "0" Then : 答案 = 個位(位數(1)) & 拾 & 萬 : Else : 答案 = 個位(位數(1)) & 拾 & 個位(位數(2)) & 萬 : End If
  1009. If 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" And 末位數 = "0" Then
  1010. ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  1011. ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾
  1012. ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾 & 個位(末位數)
  1013. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(4)) & 百
  1014. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 零 & 個位(末位數)
  1015. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾
  1016. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 個位(末位數)
  1017. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(3)) & 仟
  1018. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(末位數)
  1019. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(位數(5)) & 拾
  1020. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(位數(5)) & 拾 & 個位(末位數)
  1021. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百
  1022. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 零 & 個位(末位數)
  1023. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾
  1024. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 個位(末位數)
  1025. End If
  1026. ElseIf 數長 = 7 Then : 答案 = 個位(位數(1)) & 百
  1027. If 位數(2) = "0" And 位數(3) = "0" Then : 答案 &= 萬
  1028. ElseIf 位數(2) = "0" And 位數(3) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 萬
  1029. ElseIf 位數(2) <> "0" And 位數(3) = "0" Then : 答案 &= 個位(位數(2)) & 拾 & 萬
  1030. ElseIf 位數(2) <> "0" And 位數(3) <> "0" Then : 答案 &= 個位(位數(2)) & 拾 & 個位(位數(3)) & 萬
  1031. End If
  1032. If 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" And 末位數 = "0" Then
  1033. ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  1034. ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(6)) & 拾
  1035. ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 拾 & 個位(末位數)
  1036. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(5)) & 百
  1037. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 零 & 個位(末位數)
  1038. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾
  1039. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 個位(末位數)
  1040. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(4)) & 仟
  1041. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(末位數)
  1042. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(位數(6)) & 拾
  1043. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(位數(6)) & 拾 & 個位(末位數)
  1044. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百
  1045. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 零 & 個位(末位數)
  1046. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾
  1047. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 個位(末位數)
  1048. End If
  1049. ElseIf 數長 = 8 Then : 答案 = 個位(位數(1)) & 仟
  1050. If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= 萬
  1051. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 萬
  1052. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾 & 個位(位數(4)) & 萬
  1053. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾 & 萬
  1054. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= 個位(位數(2)) & 百 & 萬
  1055. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 零 & 個位(位數(4)) & 萬
  1056. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾 & 萬
  1057. ElseIf 位數(2) <> "0" And 位數(4) <> "0" And 位數(4) <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾 & 個位(位數(4)) & 萬
  1058. End If
  1059. If 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" And 末位數 = "0" Then
  1060. ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  1061. ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(7)) & 拾
  1062. ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 拾 & 個位(末位數)
  1063. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(6)) & 百
  1064. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 零 & 個位(末位數)
  1065. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾
  1066. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 個位(末位數)
  1067. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(5)) & 仟
  1068. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(末位數)
  1069. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(位數(7)) & 拾
  1070. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(位數(7)) & 拾 & 個位(末位數)
  1071. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百
  1072. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 零 & 個位(末位數)
  1073. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾
  1074. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 個位(末位數)
  1075. End If
  1076. ElseIf 數長 = 9 Then : 答案 = 個位(位數(1)) & 億
  1077. If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" Then
  1078. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 萬
  1079. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾 & 萬
  1080. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 萬
  1081. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 萬
  1082. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 零 & 個位(位數(5)) & 萬
  1083. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 萬
  1084. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 萬
  1085. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 萬
  1086. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(位數(5)) & 萬
  1087. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(位數(4)) & 拾 & 萬
  1088. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 萬
  1089. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 萬
  1090. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 零 & 個位(位數(5)) & 萬
  1091. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 萬
  1092. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 萬
  1093. End If
  1094. If 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" And 末位數 = "0" Then
  1095. ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  1096. ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(8)) & 拾
  1097. ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 拾 & 個位(末位數)
  1098. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(7)) & 百
  1099. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 零 & 個位(末位數)
  1100. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾
  1101. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 個位(末位數)
  1102. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(6)) & 仟
  1103. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(末位數)
  1104. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(位數(8)) & 拾
  1105. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(位數(8)) & 拾 & 個位(末位數)
  1106. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百
  1107. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 零 & 個位(末位數)
  1108. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾
  1109. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 個位(末位數)
  1110. End If
  1111. ElseIf 數長 = 10 Then
  1112. If 位數(2) = "0" Then : 答案 = 個位(位數(1)) & 拾 & 億 : Else : 答案 = 個位(位數(1)) & 拾 & 個位(位數(2)) & 億 : End If
  1113. If 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" Then
  1114. ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 萬
  1115. ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾 & 萬
  1116. ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 萬
  1117. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 萬
  1118. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 零 & 個位(位數(6)) & 萬
  1119. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 萬
  1120. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 萬
  1121. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 萬
  1122. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(位數(6)) & 萬
  1123. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(位數(5)) & 拾 & 萬
  1124. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 萬
  1125. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 萬
  1126. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 零 & 個位(位數(6)) & 萬
  1127. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 萬
  1128. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 萬
  1129. End If
  1130. If 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" And 末位數 = "0" Then
  1131. ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  1132. ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(9)) & 拾
  1133. ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(9)) & 拾 & 個位(末位數)
  1134. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(8)) & 百
  1135. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 零 & 個位(末位數)
  1136. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾
  1137. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 個位(末位數)
  1138. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(7)) & 仟
  1139. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(末位數)
  1140. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(位數(9)) & 拾
  1141. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(位數(9)) & 拾 & 個位(末位數)
  1142. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百
  1143. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 零 & 個位(末位數)
  1144. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾
  1145. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 個位(末位數)
  1146. End If
  1147. ElseIf 數長 = 11 Then : 答案 = 個位(位數(1)) & 百
  1148. If 位數(2) = "0" And 位數(3) = "0" Then : 答案 &= 億
  1149. ElseIf 位數(2) = "0" And 位數(3) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 億
  1150. ElseIf 位數(2) <> "0" And 位數(3) = "0" Then : 答案 &= 個位(位數(2)) & 拾 & 億
  1151. ElseIf 位數(2) <> "0" And 位數(3) <> "0" Then : 答案 &= 個位(位數(2)) & 拾 & 個位(位數(3)) & 億
  1152. End If
  1153. If 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" Then
  1154. ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 萬
  1155. ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= 零 & 個位(位數(6)) & 拾 & 萬
  1156. ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 拾 & 個位(位數(7)) & 萬
  1157. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 萬
  1158. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 零 & 個位(位數(7)) & 萬
  1159. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 萬
  1160. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 個位(位數(7)) & 萬
  1161. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 萬
  1162. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(位數(7)) & 萬
  1163. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(位數(6)) & 拾 & 萬
  1164. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(位數(6)) & 拾 & 個位(位數(7)) & 萬
  1165. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 萬
  1166. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 零 & 個位(位數(7)) & 萬
  1167. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 萬
  1168. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 個位(位數(7)) & 萬
  1169. End If
  1170. If 位數(8) = "0" And 位數(9) = "0" And 位數(10) = "0" And 末位數 = "0" Then
  1171. ElseIf 位數(8) = "0" And 位數(9) = "0" And 位數(10) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  1172. ElseIf 位數(8) = "0" And 位數(9) = "0" And 位數(10) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(10)) & 拾
  1173. ElseIf 位數(8) = "0" And 位數(9) = "0" And 位數(10) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(10)) & 拾 & 個位(末位數)
  1174. ElseIf 位數(8) = "0" And 位數(9) <> "0" And 位數(10) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(9)) & 百
  1175. ElseIf 位數(8) = "0" And 位數(9) <> "0" And 位數(10) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(9)) & 百 & 零 & 個位(末位數)
  1176. ElseIf 位數(8) = "0" And 位數(9) <> "0" And 位數(10) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(9)) & 百 & 個位(位數(10)) & 拾
  1177. ElseIf 位數(8) = "0" And 位數(9) <> "0" And 位數(10) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(9)) & 百 & 個位(位數(10)) & 拾 & 個位(末位數)
  1178. ElseIf 位數(8) <> "0" And 位數(9) = "0" And 位數(10) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(8)) & 仟
  1179. ElseIf 位數(8) <> "0" And 位數(9) = "0" And 位數(10) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(8)) & 仟 & 零 & 個位(末位數)
  1180. ElseIf 位數(8) <> "0" And 位數(9) = "0" And 位數(10) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(8)) & 仟 & 零 & 個位(位數(10)) & 拾
  1181. ElseIf 位數(8) <> "0" And 位數(9) = "0" And 位數(10) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(8)) & 仟 & 零 & 個位(位數(10)) & 拾 & 個位(末位數)
  1182. ElseIf 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(8)) & 仟 & 個位(位數(9)) & 百
  1183. ElseIf 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(8)) & 仟 & 個位(位數(9)) & 百 & 零 & 個位(末位數)
  1184. ElseIf 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(8)) & 仟 & 個位(位數(9)) & 百 & 個位(位數(10)) & 拾
  1185. ElseIf 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(8)) & 仟 & 個位(位數(9)) & 百 & 個位(位數(10)) & 拾 & 個位(末位數)
  1186. End If
  1187. ElseIf 數長 = 12 Then : 答案 = 個位(位數(1)) & 仟
  1188. If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= 億
  1189. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 億
  1190. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾 & 個位(位數(4)) & 億
  1191. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾 & 億
  1192. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= 個位(位數(2)) & 百 & 億
  1193. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 零 & 個位(位數(4)) & 億
  1194. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾 & 億
  1195. ElseIf 位數(2) <> "0" And 位數(4) <> "0" And 位數(4) <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾 & 個位(位數(4)) & 億
  1196. End If
  1197. If 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" Then
  1198. ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 萬
  1199. ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= 零 & 個位(位數(7)) & 拾 & 萬
  1200. ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 拾 & 個位(位數(8)) & 萬
  1201. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 萬
  1202. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 零 & 個位(位數(8)) & 萬
  1203. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 萬
  1204. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 個位(位數(8)) & 萬
  1205. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 萬
  1206. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(位數(8)) & 萬
  1207. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(位數(7)) & 拾 & 萬
  1208. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(位數(7)) & 拾 & 個位(位數(8)) & 萬
  1209. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 萬
  1210. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 零 & 個位(位數(8)) & 萬
  1211. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 萬
  1212. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 個位(位數(8)) & 萬
  1213. End If
  1214. If 位數(9) = "0" And 位數(10) = "0" And 位數(11) = "0" And 末位數 = "0" Then
  1215. ElseIf 位數(9) = "0" And 位數(10) = "0" And 位數(11) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  1216. ElseIf 位數(9) = "0" And 位數(10) = "0" And 位數(11) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(11)) & 拾
  1217. ElseIf 位數(9) = "0" And 位數(10) = "0" And 位數(11) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(11)) & 拾 & 個位(末位數)
  1218. ElseIf 位數(9) = "0" And 位數(10) <> "0" And 位數(11) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(10)) & 百
  1219. ElseIf 位數(9) = "0" And 位數(10) <> "0" And 位數(11) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(10)) & 百 & 零 & 個位(末位數)
  1220. ElseIf 位數(9) = "0" And 位數(10) <> "0" And 位數(11) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(10)) & 百 & 個位(位數(11)) & 拾
  1221. ElseIf 位數(9) = "0" And 位數(10) <> "0" And 位數(11) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(10)) & 百 & 個位(位數(11)) & 拾 & 個位(末位數)
  1222. ElseIf 位數(9) <> "0" And 位數(10) = "0" And 位數(11) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(9)) & 仟
  1223. ElseIf 位數(9) <> "0" And 位數(10) = "0" And 位數(11) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(9)) & 仟 & 零 & 個位(末位數)
  1224. ElseIf 位數(9) <> "0" And 位數(10) = "0" And 位數(11) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(9)) & 仟 & 零 & 個位(位數(11)) & 拾
  1225. ElseIf 位數(9) <> "0" And 位數(10) = "0" And 位數(11) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(9)) & 仟 & 零 & 個位(位數(11)) & 拾 & 個位(末位數)
  1226. ElseIf 位數(9) <> "0" And 位數(10) <> "0" And 位數(11) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(9)) & 仟 & 個位(位數(10)) & 百
  1227. ElseIf 位數(9) <> "0" And 位數(10) <> "0" And 位數(11) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(9)) & 仟 & 個位(位數(10)) & 百 & 零 & 個位(末位數)
  1228. ElseIf 位數(9) <> "0" And 位數(10) <> "0" And 位數(11) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(9)) & 仟 & 個位(位數(10)) & 百 & 個位(位數(11)) & 拾
  1229. ElseIf 位數(9) <> "0" And 位數(10) <> "0" And 位數(11) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(9)) & 仟 & 個位(位數(10)) & 百 & 個位(位數(11)) & 拾 & 個位(末位數)
  1230. End If
  1231. ElseIf 數長 = 13 Then : 答案 = 個位(位數(1)) & 兆 : 答案 &= 個位(位數(2)) & 仟
  1232. If 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= 億
  1233. ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 億
  1234. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 億
  1235. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾 & 億
  1236. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(3)) & 百 & 億
  1237. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(3)) & 百 & 零 & 個位(位數(5)) & 億
  1238. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 億
  1239. ElseIf 位數(3) <> "0" And 位數(5) <> "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 億
  1240. End If
  1241. If 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" Then
  1242. ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" Then : 答案 &= 零 & 個位(位數(9)) & 萬
  1243. ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= 零 & 個位(位數(8)) & 拾 & 萬
  1244. ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 拾 & 個位(位數(9)) & 萬
  1245. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 萬
  1246. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 零 & 個位(位數(9)) & 萬
  1247. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 萬
  1248. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 個位(位數(9)) & 萬
  1249. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 萬
  1250. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(位數(9)) & 萬
  1251. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(位數(8)) & 拾 & 萬
  1252. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(位數(8)) & 拾 & 個位(位數(9)) & 萬
  1253. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 萬
  1254. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 零 & 個位(位數(9)) & 萬
  1255. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 萬
  1256. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 個位(位數(9)) & 萬
  1257. End If
  1258. If 位數(10) = "0" And 位數(11) = "0" And 位數(12) = "0" And 末位數 = "0" Then
  1259. ElseIf 位數(10) = "0" And 位數(11) = "0" And 位數(12) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  1260. ElseIf 位數(10) = "0" And 位數(11) = "0" And 位數(12) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(12)) & 拾
  1261. ElseIf 位數(10) = "0" And 位數(11) = "0" And 位數(12) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(12)) & 拾 & 個位(末位數)
  1262. ElseIf 位數(10) = "0" And 位數(11) <> "0" And 位數(12) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(11)) & 百
  1263. ElseIf 位數(10) = "0" And 位數(11) <> "0" And 位數(12) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(11)) & 百 & 零 & 個位(末位數)
  1264. ElseIf 位數(10) = "0" And 位數(11) <> "0" And 位數(12) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(11)) & 百 & 個位(位數(12)) & 拾
  1265. ElseIf 位數(10) = "0" And 位數(11) <> "0" And 位數(12) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(11)) & 百 & 個位(位數(12)) & 拾 & 個位(末位數)
  1266. ElseIf 位數(10) <> "0" And 位數(11) = "0" And 位數(12) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(10)) & 仟
  1267. ElseIf 位數(10) <> "0" And 位數(11) = "0" And 位數(12) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(10)) & 仟 & 零 & 個位(末位數)
  1268. ElseIf 位數(10) <> "0" And 位數(11) = "0" And 位數(12) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(10)) & 仟 & 零 & 個位(位數(12)) & 拾
  1269. ElseIf 位數(10) <> "0" And 位數(11) = "0" And 位數(12) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(10)) & 仟 & 零 & 個位(位數(12)) & 拾 & 個位(末位數)
  1270. ElseIf 位數(10) <> "0" And 位數(11) <> "0" And 位數(12) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(10)) & 仟 & 個位(位數(11)) & 百
  1271. ElseIf 位數(10) <> "0" And 位數(11) <> "0" And 位數(12) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(10)) & 仟 & 個位(位數(11)) & 百 & 零 & 個位(末位數)
  1272. ElseIf 位數(10) <> "0" And 位數(11) <> "0" And 位數(12) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(10)) & 仟 & 個位(位數(11)) & 百 & 個位(位數(12)) & 拾
  1273. ElseIf 位數(10) <> "0" And 位數(11) <> "0" And 位數(12) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(10)) & 仟 & 個位(位數(11)) & 百 & 個位(位數(12)) & 拾 & 個位(末位數)
  1274. End If
  1275. ElseIf 數長 = 14 Then
  1276. If 位數(2) = "0" Then : 答案 = 個位(位數(1)) & 拾 & 兆 : Else : 答案 = 個位(位數(1)) & 拾 & 個位(位數(2)) & 兆 : End If : 答案 &= 個位(位數(3)) & 仟
  1277. If 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= 億
  1278. ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 億
  1279. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 億
  1280. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾 & 億
  1281. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(4)) & 百 & 億
  1282. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(4)) & 百 & 零 & 個位(位數(6)) & 億
  1283. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 億
  1284. ElseIf 位數(4) <> "0" And 位數(6) <> "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 億
  1285. End If
  1286. If 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" And 位數(10) = "0" Then
  1287. ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" And 位數(10) <> "0" Then : 答案 &= 零 & 個位(位數(10)) & 萬
  1288. ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= 零 & 個位(位數(9)) & 拾 & 萬
  1289. ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= 零 & 個位(位數(9)) & 拾 & 個位(位數(10)) & 萬
  1290. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" And 位數(10) = "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 萬
  1291. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" And 位數(10) <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 零 & 個位(位數(10)) & 萬
  1292. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 萬
  1293. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 個位(位數(10)) & 萬
  1294. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" And 位數(10) = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 萬
  1295. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" And 位數(10) <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(位數(10)) & 萬
  1296. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(位數(9)) & 拾 & 萬
  1297. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(位數(9)) & 拾 & 個位(位數(10)) & 萬
  1298. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" And 位數(10) = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 萬
  1299. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" And 位數(10) <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 零 & 個位(位數(10)) & 萬
  1300. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 萬
  1301. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 個位(位數(10)) & 萬
  1302. End If
  1303. If 位數(11) = "0" And 位數(12) = "0" And 位數(13) = "0" And 末位數 = "0" Then
  1304. ElseIf 位數(11) = "0" And 位數(12) = "0" And 位數(13) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  1305. ElseIf 位數(11) = "0" And 位數(12) = "0" And 位數(13) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(13)) & 拾
  1306. ElseIf 位數(11) = "0" And 位數(12) = "0" And 位數(13) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(13)) & 拾 & 個位(末位數)
  1307. ElseIf 位數(11) = "0" And 位數(12) <> "0" And 位數(13) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(12)) & 百
  1308. ElseIf 位數(11) = "0" And 位數(12) <> "0" And 位數(13) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(12)) & 百 & 零 & 個位(末位數)
  1309. ElseIf 位數(11) = "0" And 位數(12) <> "0" And 位數(13) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(12)) & 百 & 個位(位數(13)) & 拾
  1310. ElseIf 位數(11) = "0" And 位數(12) <> "0" And 位數(13) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(12)) & 百 & 個位(位數(13)) & 拾 & 個位(末位數)
  1311. ElseIf 位數(11) <> "0" And 位數(12) = "0" And 位數(13) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(11)) & 仟
  1312. ElseIf 位數(11) <> "0" And 位數(12) = "0" And 位數(13) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(11)) & 仟 & 零 & 個位(末位數)
  1313. ElseIf 位數(11) <> "0" And 位數(12) = "0" And 位數(13) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(11)) & 仟 & 零 & 個位(位數(13)) & 拾
  1314. ElseIf 位數(11) <> "0" And 位數(12) = "0" And 位數(13) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(11)) & 仟 & 零 & 個位(位數(13)) & 拾 & 個位(末位數)
  1315. ElseIf 位數(11) <> "0" And 位數(12) <> "0" And 位數(13) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(11)) & 仟 & 個位(位數(12)) & 百
  1316. ElseIf 位數(11) <> "0" And 位數(12) <> "0" And 位數(13) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(11)) & 仟 & 個位(位數(12)) & 百 & 零 & 個位(末位數)
  1317. ElseIf 位數(11) <> "0" And 位數(12) <> "0" And 位數(13) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(11)) & 仟 & 個位(位數(12)) & 百 & 個位(位數(13)) & 拾
  1318. ElseIf 位數(11) <> "0" And 位數(12) <> "0" And 位數(13) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(11)) & 仟 & 個位(位數(12)) & 百 & 個位(位數(13)) & 拾 & 個位(末位數)
  1319. End If
  1320. End If
  1321. End If
  1322. If 系統語言 = "繁體中文" Then : 金額大寫_tb.Text = 答案 & " 元整"
  1323. ElseIf 系統語言 = "Indonesian" Then : 金額大寫_tb.Text = 答案 & " Rupiah"
  1324. ElseIf 系統語言 = "English" Then : 金額大寫_tb.Text = 答案 & " Rupee" : End If
  1325. End Sub
  1326. Private Sub 列印成EXCEL_bt_Click(sender As Object, e As EventArgs) Handles 列印成EXCEL_bt.Click
  1327. If 主管_tb.Text = "" Then : MGB(對話框(9), 1) : Else
  1328. If 系統單號_bt.Text = "" Then : MGB(對話框(3), 1) : 首次開啟 = False : Else
  1329. xlApp = CType(CreateObject("Excel.Application"), Application)
  1330. xlBook = xlApp.Workbooks.Add
  1331. xlApp.DisplayAlerts = True
  1332. xlApp.Visible = True
  1333. xlApp.Application.WindowState = xlMaximized
  1334. xlSheet = NewMethod(xlBook) : xlApp.Sheets(1).Select
  1335. xlApp.Sheets(1).Name = 單號_tb.Text.Replace("/", "_") : xlBook.Activate() : xlSheet.Activate()
  1336. xlSheet.Cells(2, 1) = Label7.Text
  1337. xlSheet.Cells(3, 1) = 單號_tb.Text
  1338. xlSheet.Cells(5, 2) = Label2.Text : xlSheet.Cells(5, 3) = "' : " : xlSheet.Cells(5, 4) = "'" & Strings.Format(申請日期_dtp.Value, "yyyy/MM/dd")
  1339. xlSheet.Cells(6, 2) = Label1.Text : xlSheet.Cells(6, 3) = "' : " : xlSheet.Cells(6, 4) = 部門選單_cb.Text
  1340. xlSheet.Cells(7, 2) = Label3.Text : xlSheet.Cells(7, 3) = "' : " : xlSheet.Cells(7, 4) = Strings.Format(申請金額_nud.Value, "#,##0")
  1341. xlSheet.Cells(8, 2) = Label4.Text : xlSheet.Cells(8, 3) = "' : " : xlSheet.Cells(8, 4) = 金額大寫_tb.Text
  1342. xlSheet.Cells(9, 2) = Label5.Text : xlSheet.Cells(9, 3) = "' : " : xlSheet.Cells(9, 4) = 內容_tb.Text
  1343. xlSheet.Cells(10, 2) = Label6.Text : xlSheet.Cells(10, 3) = "' : "
  1344. xlSheet.Cells(10, 4) = Label18.Text & " / " & 支付對象_tb.Text & vbLf &
  1345. Label15.Text & " / " & 營行帳號_tb.Text & vbLf &
  1346. Label17.Text & " / " & 支付銀行_tb.Text & vbLf &
  1347. Label16.Text & " / " & 銀行支行_tb.Text
  1348. xlSheet.Cells(12, 2) = Label8.Text : xlSheet.Cells(14, 2) = "Staff"
  1349. xlSheet.Cells(12, 4) = Label19.Text : xlSheet.Cells(14, 4) = "DCC"
  1350. xlSheet.Cells(12, 6) = Label9.Text : xlSheet.Cells(14, 6) = Label11.Text
  1351. xlSheet.Cells(12, 8) = Label10.Text : xlSheet.Cells(14, 8) = Label12.Text
  1352. AA(xlApp, xlSheet)
  1353. If 單號_tb.Text.Contains("HXI") Then : CC(xlApp, xlSheet) : Else : DD(xlApp, xlSheet) : End If
  1354. If IsNothing(簽名圖1_pb.Image) = True Then : xlSheet.Cells(13, 2) = 申請人_tb.Text : Else : 申請人簽名(xlApp, xlSheet) : End If
  1355. If IsNothing(簽名圖2_pb.Image) = True Then : xlSheet.Cells(13, 4) = 檢查人_tb.Text : Else : 檢查人簽名(xlApp, xlSheet) : End If
  1356. If IsNothing(簽名圖3_pb.Image) = True Then : xlSheet.Cells(13, 6) = 主管_tb.Text : Else : 主管簽名(xlApp, xlSheet) : End If
  1357. If IsNothing(簽名圖4_pb.Image) = True Then : xlSheet.Cells(13, 8) = 審核人_tb.Text : Else : 審核人簽名(xlApp, xlSheet) : End If
  1358. xlApp.Sheets(2).Delete : xlSheet.PageSetup.PrintArea = ""
  1359. '-------------轉換成PDF---------------------------------------------------------------------
  1360. Dim SERT As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
  1361. xlBook.Sheets(1).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, SERT & "\" & 單號_tb.Text.Replace("/", "_") & ".pdf", XlFixedFormatQuality.xlQualityStandard, True)
  1362. '-------------關閉EXCEL---------------------------------------------------------------------
  1363. xlApp.Cells.Select() : xlApp.Application.WindowState = xlMinimized
  1364. xlBook.Close(False)
  1365. Runtime.InteropServices.Marshal.ReleaseComObject(xlSheet)
  1366. Runtime.InteropServices.Marshal.ReleaseComObject(xlBook)
  1367. Runtime.InteropServices.Marshal.ReleaseComObject(xlApp)
  1368. xlApp.Quit() : xlSheet = Nothing : xlBook = Nothing : xlApp = Nothing : GC.Collect()
  1369. '-------------開啟PDF---------------------------------------------------------------------
  1370. Dim pdfFilePath As String = SERT & "\" & 單號_tb.Text.Replace("/", "_") & ".pdf"
  1371. If IsChromeInstalled() Then
  1372. Try
  1373. Dim chromeProcess As New Process()
  1374. chromeProcess.StartInfo.FileName = "chrome"
  1375. chromeProcess.StartInfo.Arguments = """" & pdfFilePath & """"
  1376. chromeProcess.Start()
  1377. Catch ex As Exception
  1378. End Try
  1379. Else
  1380. Try
  1381. System.Diagnostics.Process.Start("""" & pdfFilePath & """")
  1382. Catch ex As Exception
  1383. End Try
  1384. End If
  1385. MGB(系統語言字典("H508-121-" & 語言), 1) : 首次開啟 = False
  1386. End If
  1387. End If
  1388. End Sub
  1389. Private Function IsChromeInstalled() As Boolean
  1390. Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
  1391. If key IsNot Nothing Then
  1392. For Each subkeyName As String In key.GetSubKeyNames()
  1393. Dim subkey As Microsoft.Win32.RegistryKey = key.OpenSubKey(subkeyName)
  1394. Dim displayName As Object = subkey.GetValue("DisplayName")
  1395. If displayName IsNot Nothing AndAlso displayName.ToString().Contains("Google Chrome") Then
  1396. Return True
  1397. End If
  1398. Next
  1399. End If
  1400. Return False
  1401. End Function
  1402. Private Shared Function NewMethod(xlBook As Workbook) As Worksheet
  1403. Return CType(xlBook.Worksheets.Add, Worksheet)
  1404. End Function
  1405. Private Sub 申請人簽名(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Worksheet)
  1406. Clipboard.SetDataObject(簽名圖1_pb.Image) : xlSheet.Range("B13").Select()
  1407. myExcel.ActiveSheet.Pictures.Paste.Select : myExcel.Selection.ShapeRange.Height = 40
  1408. myExcel.Selection.ShapeRange.IncrementLeft(25) : myExcel.Selection.ShapeRange.IncrementTop(2)
  1409. End Sub
  1410. Private Sub 檢查人簽名(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Worksheet)
  1411. Clipboard.SetDataObject(簽名圖2_pb.Image) : xlSheet.Range("D13").Select()
  1412. myExcel.ActiveSheet.Pictures.Paste.Select : myExcel.Selection.ShapeRange.Height = 40
  1413. myExcel.Selection.ShapeRange.IncrementLeft(40) : myExcel.Selection.ShapeRange.IncrementTop(2)
  1414. End Sub
  1415. Private Sub 主管簽名(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Worksheet)
  1416. Clipboard.SetDataObject(簽名圖3_pb.Image) : xlSheet.Range("F13").Select()
  1417. myExcel.ActiveSheet.Pictures.Paste.Select : myExcel.Selection.ShapeRange.Height = 40
  1418. myExcel.Selection.ShapeRange.IncrementLeft(40) : myExcel.Selection.ShapeRange.IncrementTop(2)
  1419. End Sub
  1420. Private Sub 審核人簽名(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Worksheet)
  1421. Clipboard.SetDataObject(簽名圖4_pb.Image) : xlSheet.Range("H13").Select()
  1422. myExcel.ActiveSheet.Pictures.Paste.Select : myExcel.Selection.ShapeRange.Height = 40
  1423. myExcel.Selection.ShapeRange.IncrementLeft(40) : myExcel.Selection.ShapeRange.IncrementTop(2)
  1424. End Sub
  1425. Private Sub AA(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Worksheet)
  1426. xlSheet.Cells.Select()
  1427. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  1428. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1429. xlSheet.Rows("1:1").Select : myExcel.Selection.RowHeight = 90 : xlSheet.Rows("2:2").Select : myExcel.Selection.RowHeight = 25
  1430. xlSheet.Rows("3:3").Select : myExcel.Selection.RowHeight = 19 : xlSheet.Rows("5:7").Select : myExcel.Selection.RowHeight = 25
  1431. xlSheet.Rows("8:8").Select : myExcel.Selection.RowHeight = 50 : xlSheet.Rows("9:9").Select : myExcel.Selection.RowHeight = 100
  1432. xlSheet.Rows("10:10").Select : myExcel.Selection.RowHeight = 80 : xlSheet.Rows("13:13").Select : myExcel.Selection.RowHeight = 50
  1433. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 4 : xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 20
  1434. xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 1.7 : xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 30
  1435. xlSheet.Columns("E:E").Select : myExcel.Selection.ColumnWidth = 10 : xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 30
  1436. xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 10 : xlSheet.Columns("H:H").Select : myExcel.Selection.ColumnWidth = 30
  1437. xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 4
  1438. xlSheet.Range("A2:I2").Select()
  1439. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1440. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1441. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 22 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  1442. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1443. xlSheet.Range("A3:I3").Select()
  1444. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1445. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1446. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 14 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  1447. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1448. xlSheet.Range("B5:C10").Select()
  1449. With myExcel.Selection : .HorizontalAlignment = xlGeneral : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1450. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1451. xlSheet.Range("D5:H5").Select()
  1452. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1453. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1454. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1455. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1456. xlSheet.Range("D6:H6").Select()
  1457. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1458. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1459. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1460. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1461. xlSheet.Range("D7:H7").Select()
  1462. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1463. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1464. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1465. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1466. xlSheet.Range("D8:H8").Select()
  1467. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1468. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1469. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1470. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1471. xlSheet.Range("D9:H9").Select()
  1472. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1473. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1474. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1475. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1476. xlSheet.Range("D10:H10").Select()
  1477. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1478. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1479. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1480. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1481. xlSheet.Range("D12:H14").Select()
  1482. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1483. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1484. xlSheet.Range("A1:I2").Select()
  1485. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1486. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1487. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1488. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1489. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1490. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1491. xlSheet.Range("A3:I3").Select()
  1492. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1493. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1494. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1495. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1496. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1497. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1498. xlSheet.Range("A4:I14").Select()
  1499. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1500. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1501. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1502. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1503. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1504. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1505. xlSheet.Range("D5:H5").Select()
  1506. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1507. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1508. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1509. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1510. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1511. xlSheet.Range("D6:H6").Select()
  1512. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1513. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  1514. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1515. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1516. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1517. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1518. xlSheet.Range("D7:H7").Select()
  1519. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1520. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  1521. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1522. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1523. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1524. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1525. xlSheet.Range("D8:H8").Select()
  1526. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1527. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  1528. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1529. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1530. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1531. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1532. xlSheet.Range("D9:H9").Select()
  1533. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1534. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  1535. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1536. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1537. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1538. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1539. xlSheet.Range("D10:H10").Select()
  1540. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1541. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  1542. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1543. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1544. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1545. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1546. xlSheet.Range("F13").Select()
  1547. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1548. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1549. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1550. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1551. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1552. xlSheet.Range("H13").Select()
  1553. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1554. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1555. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1556. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1557. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1558. myExcel.ActiveWindow.DisplayGridlines = False
  1559. xlSheet.Range("B5:B10").Select() : myExcel.Selection.Font.Bold = True : xlSheet.Range("D12:H12").Select() : myExcel.Selection.Font.Bold = True
  1560. xlSheet.Range("F14:H14").Select() : myExcel.Selection.Font.Bold = True
  1561. xlSheet.Range("D8:H10").Select()
  1562. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1563. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : End With
  1564. xlSheet.Range("B13").Select()
  1565. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1566. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1567. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1568. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1569. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1570. With myExcel.Selection : .HorizontalAlignment = xlGeneral : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1571. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1572. xlSheet.Range("D13").Select()
  1573. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1574. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1575. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1576. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1577. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1578. With myExcel.Selection : .HorizontalAlignment = xlGeneral : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1579. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1580. xlSheet.Range("B12").Select()
  1581. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1582. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1583. xlSheet.Range("B14").Select()
  1584. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1585. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1586. If Strings.Mid(單號_tb.Text, 9, 3) = "PGS" Then
  1587. myExcel.ActiveSheet.PageSetup.CenterHeaderPicture.Filename =
  1588. Str01 & "\PGSBWLOG.png"
  1589. Else
  1590. myExcel.ActiveSheet.PageSetup.CenterHeaderPicture.Filename =
  1591. Str01 & "\HXBWLOG.png"
  1592. End If
  1593. xlSheet.Range("D14").Select() : myExcel.Selection.Font.Bold = True
  1594. xlSheet.Range("B14").Select() : myExcel.Selection.Font.Bold = True
  1595. xlSheet.Range("B12").Select() : myExcel.Selection.Font.Bold = True
  1596. myExcel.Application.PrintCommunication = False : With myExcel.ActiveSheet.PageSetup : .PrintTitleRows = "" : .PrintTitleColumns = "" : End With
  1597. myExcel.Application.PrintCommunication = True : myExcel.ActiveSheet.PageSetup.PrintArea = "" : myExcel.Application.PrintCommunication = False
  1598. With myExcel.ActiveSheet.PageSetup : .LeftHeader = ""
  1599. .CenterHeader = "" & Chr(10) & "" & Chr(10) & "" & Chr(10) & "" & Chr(10) & "" & Chr(10) & "" & Chr(10) & "" & Chr(10) & "" & Chr(10) & "&G"
  1600. .RightHeader = "" : .LeftFooter = "" : .CenterFooter = "" : .RightFooter = ""
  1601. .LeftMargin = myExcel.Application.InchesToPoints(0.25) : .RightMargin = myExcel.Application.InchesToPoints(0.25)
  1602. .TopMargin = myExcel.Application.InchesToPoints(0.75) : .BottomMargin = myExcel.Application.InchesToPoints(0.75)
  1603. .HeaderMargin = myExcel.Application.InchesToPoints(0.3) : .FooterMargin = myExcel.Application.InchesToPoints(0.3)
  1604. .PrintHeadings = False : .PrintGridlines = False : .CenterHorizontally = True : .CenterVertically = False : .Orientation = XlPageOrientation.xlLandscape
  1605. .Draft = False : .FirstPageNumber = xlAutomatic : .BlackAndWhite = False : .Zoom = False : .FitToPagesWide = 0 : .FitToPagesTall = 1
  1606. .OddAndEvenPagesHeaderFooter = False : .DifferentFirstPageHeaderFooter = False : .ScaleWithDocHeaderFooter = True : .AlignMarginsHeaderFooter = True
  1607. .EvenPage.LeftHeader.Text = "" : .EvenPage.CenterHeader.Text = "" : .EvenPage.RightHeader.Text = "" : .EvenPage.LeftFooter.Text = ""
  1608. .EvenPage.CenterFooter.Text = "" : .EvenPage.RightFooter.Text = "" : .FirstPage.LeftHeader.Text = "" : .FirstPage.CenterHeader.Text = ""
  1609. .FirstPage.RightHeader.Text = "" : .FirstPage.LeftFooter.Text = "" : .FirstPage.CenterFooter.Text = "" : .FirstPage.RightFooter.Text = ""
  1610. End With
  1611. myExcel.Application.PrintCommunication = True
  1612. End Sub
  1613. Private Sub CC(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Worksheet)
  1614. Clipboard.SetDataObject(PictureBox1.Image)
  1615. xlSheet.Range("A1").Select()
  1616. myExcel.ActiveSheet.Pictures.Paste.Select
  1617. myExcel.Selection.ShapeRange.Height = 88
  1618. myExcel.Selection.ShapeRange.IncrementLeft(50)
  1619. myExcel.Selection.ShapeRange.IncrementTop(2)
  1620. End Sub
  1621. Private Sub DD(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Worksheet)
  1622. Clipboard.SetDataObject(PictureBox2.Image)
  1623. xlSheet.Range("A1").Select()
  1624. myExcel.ActiveSheet.Pictures.Paste.Select
  1625. myExcel.Selection.ShapeRange.Height = 88
  1626. myExcel.Selection.ShapeRange.IncrementLeft(50)
  1627. myExcel.Selection.ShapeRange.IncrementTop(2)
  1628. End Sub
  1629. Private Sub HX_ch_CheckedChanged(sender As Object, e As EventArgs) Handles HX_ch.Click
  1630. HX_ch.Checked = True : PGS_ch.Checked = False : ALL_ch.Checked = False : Set_清單1()
  1631. End Sub
  1632. Private Sub PGS_ch_CheckedChanged(sender As Object, e As EventArgs) Handles PGS_ch.Click
  1633. HX_ch.Checked = False : PGS_ch.Checked = True : ALL_ch.Checked = False : Set_清單1()
  1634. End Sub
  1635. Private Sub ALL_ch_CheckedChanged(sender As Object, e As EventArgs) Handles ALL_ch.Click
  1636. HX_ch.Checked = False : PGS_ch.Checked = False : ALL_ch.Checked = True : Set_清單1()
  1637. End Sub
  1638. Private Sub 月_ch_Click(sender As Object, e As EventArgs) Handles 月_ch.Click
  1639. 月_ch.Checked = True : 週_ch.Checked = False : 日_ch.Checked = False : 修改BT() : 當月_bt.PerformClick()
  1640. End Sub
  1641. Private Sub 週_ch_Click(sender As Object, e As EventArgs) Handles 週_ch.Click
  1642. 月_ch.Checked = False : 週_ch.Checked = True : 日_ch.Checked = False : 修改BT() : 當月_bt.PerformClick()
  1643. End Sub
  1644. Private Sub 日_ch_Click(sender As Object, e As EventArgs) Handles 日_ch.Click
  1645. 月_ch.Checked = False : 週_ch.Checked = False : 日_ch.Checked = True : 修改BT() : 當月_bt.PerformClick()
  1646. End Sub
  1647. Private Sub 當月_bt_Click(sender As Object, e As EventArgs) Handles 當月_bt.Click
  1648. If 月_ch.Checked Then
  1649. 開始日期_dtp.Value = New Date(Today.Year, Today.Month, 1)
  1650. 結束日期_dtp.Value = 開始日期_dtp.Value.AddMonths(1).AddDays(-1)
  1651. ElseIf 週_ch.Checked Then
  1652. 開始日期_dtp.Value = Today.AddDays(-Today.DayOfWeek)
  1653. 結束日期_dtp.Value = Today.AddDays(6 - Today.DayOfWeek)
  1654. ElseIf 日_ch.Checked Then
  1655. 開始日期_dtp.Value = Today
  1656. 結束日期_dtp.Value = Today
  1657. End If
  1658. End Sub
  1659. Private Sub 上個月_bt_Click(sender As Object, e As EventArgs) Handles 上個月_bt.Click
  1660. If 月_ch.Checked Then
  1661. Dim today As Date = 開始日期_dtp.Value
  1662. Dim 前一個月第一天 As Date = today.AddMonths(-1).AddDays(1 - today.Day)
  1663. Dim 前一個月最後一天 As Date = 前一個月第一天.AddMonths(1).AddDays(-1)
  1664. 開始日期_dtp.Value = 前一個月第一天
  1665. 結束日期_dtp.Value = 前一個月最後一天
  1666. ElseIf 週_ch.Checked Then
  1667. Dim today As Date = 開始日期_dtp.Value
  1668. Dim 前一週第一天 As Date = today.AddDays(-7)
  1669. Dim 前一週最後一天 As Date = today.AddDays(-1)
  1670. 開始日期_dtp.Value = 前一週第一天
  1671. 結束日期_dtp.Value = 前一週最後一天
  1672. ElseIf 日_ch.Checked Then
  1673. Dim today As Date = 開始日期_dtp.Value
  1674. 開始日期_dtp.Value = today.AddDays(-1)
  1675. 結束日期_dtp.Value = today.AddDays(-1)
  1676. End If
  1677. End Sub
  1678. Private Sub 下個月_bt_Click(sender As Object, e As EventArgs) Handles 下個月_bt.Click
  1679. If 月_ch.Checked Then
  1680. Dim today As Date = 開始日期_dtp.Value
  1681. Dim 下個月第一天 As Date = today.AddMonths(1).AddDays(-today.Day + 1)
  1682. Dim 下個月最後一天 As Date = 下個月第一天.AddMonths(1).AddDays(-1)
  1683. 開始日期_dtp.Value = 下個月第一天
  1684. 結束日期_dtp.Value = 下個月最後一天
  1685. ElseIf 週_ch.Checked Then
  1686. Dim today As Date = 開始日期_dtp.Value
  1687. Dim 下一週第一天 As Date = today.AddDays(7)
  1688. Dim 下一週最後一天 As Date = today.AddDays(13)
  1689. 開始日期_dtp.Value = 下一週第一天
  1690. 結束日期_dtp.Value = 下一週最後一天
  1691. ElseIf 日_ch.Checked Then
  1692. Dim today As Date = 開始日期_dtp.Value
  1693. 開始日期_dtp.Value = today.AddDays(1)
  1694. 結束日期_dtp.Value = today.AddDays(1)
  1695. End If
  1696. End Sub
  1697. Private Sub 支付對象_cb_Click(sender As Object, e As EventArgs) Handles 支付對象_cb.Click
  1698. CB選擇清單(支付對象_cb, 支付對象_cb.Text)
  1699. End Sub
  1700. Private Sub 支付對象_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 支付對象_cb.SelectedIndexChanged
  1701. If 支付對象_cb.Text.Substring(0, 1) = "A" Then
  1702. For i As Integer = 0 To 支付對象1_dgv.Rows.Count - 1
  1703. Dim 要寫入的文字 As String = 支付對象_cb.Text.Substring(2)
  1704. If 要寫入的文字 = 支付對象1_dgv.Rows(i).Cells(1).Value.ToString Then
  1705. 支付對象_cb.Text = 支付對象1_dgv.Rows(i).Cells(2).Value.ToString : 支付對象_tb.Text = 支付對象1_dgv.Rows(i).Cells(2).Value.ToString
  1706. 支付銀行_tb.Text = 支付對象1_dgv.Rows(i).Cells(3).Value.ToString : 營行帳號_tb.Text = 支付對象1_dgv.Rows(i).Cells(4).Value.ToString
  1707. 銀行支行_tb.Text = 支付對象1_dgv.Rows(i).Cells(5).Value.ToString : 公司_lb.Text = 支付對象1_dgv.Rows(i).Cells(1).Value.ToString
  1708. Exit For
  1709. End If
  1710. Next
  1711. 支付銀行_tb.Enabled = False : 營行帳號_tb.Enabled = False : 銀行支行_tb.Enabled = False
  1712. ElseIf 支付對象_cb.Text.Substring(0, 1) = "B" Then
  1713. SQL_查詢支付對象資料(支付對象_cb.Text.Substring(2))
  1714. If dr.Read() Then
  1715. 支付對象_cb.Text = dr(0).ToString : 支付對象_tb.Text = dr(0).ToString
  1716. 支付銀行_tb.Text = dr(1).ToString : 營行帳號_tb.Text = dr(2).ToString
  1717. 銀行支行_tb.Text = dr(3).ToString : 公司_lb.Text = ""
  1718. Else
  1719. 支付對象_cb.Text = 支付對象_cb.Text.Substring(2) : 支付對象_tb.Text = 支付對象_cb.Text.Substring(2)
  1720. 支付銀行_tb.Text = "" : 營行帳號_tb.Text = "" : 銀行支行_tb.Text = ""
  1721. End If
  1722. 支付銀行_tb.Enabled = True : 營行帳號_tb.Enabled = True : 銀行支行_tb.Enabled = True
  1723. End If
  1724. End Sub
  1725. Private Sub 條件_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 條件_cb.SelectedIndexChanged
  1726. If 已開啟 = True Then : Set_清單1() : End If
  1727. End Sub
  1728. Private Sub 解開星期五_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 解開星期五_ch.Click
  1729. If 解開星期五_ch.Checked = True Then : 支付日期_dtp.Enabled = True : Else : 支付日期_dtp.Enabled = False : End If
  1730. End Sub
  1731. Private Sub 結束日期_dtp_ValueChanged(sender As Object, e As EventArgs) Handles 結束日期_dtp.ValueChanged
  1732. If 已開啟 = True Then : Set_清單1() : End If
  1733. End Sub
  1734. Private Sub 風格()
  1735. If 深色風格 = False Then
  1736. Me.BackColor = SystemColors.Control
  1737. 財務單號_lb.ForeColor = Color.Black : Label1.ForeColor = Color.Black : Label2.ForeColor = Color.Black : 補單_cb.ForeColor = Color.Black
  1738. Label3.ForeColor = Color.Black : Label4.ForeColor = Color.Black : Label5.ForeColor = Color.Black : 會計科目_lb.ForeColor = Color.Black
  1739. Label6.ForeColor = Color.Black : Label7.ForeColor = Color.Black : Label8.ForeColor = Color.Black : Label9.ForeColor = Color.Black
  1740. Label10.ForeColor = Color.Black : Label11.ForeColor = Color.Black : Label12.ForeColor = Color.Black : Label13.ForeColor = Color.Black
  1741. Label14.ForeColor = Color.Black : HX_ch.ForeColor = Color.Black : PGS_ch.ForeColor = Color.Black : ALL_ch.ForeColor = Color.Black
  1742. Label18.ForeColor = Color.Black : Label17.ForeColor = Color.Black : Label15.ForeColor = Color.Black : Label16.ForeColor = Color.Black
  1743. Label19.ForeColor = Color.Black
  1744. 單號_tb.BackColor = Color.White : 單號_tb.ForeColor = Color.Black : 部門選單_cb.BackColor = Color.White : 部門選單_cb.ForeColor = Color.Black
  1745. 申請金額_nud.BackColor = Color.White : 申請金額_nud.ForeColor = Color.Black : 金額大寫_tb.BackColor = Color.White : 金額大寫_tb.ForeColor = Color.Black
  1746. 內容_tb.BackColor = Color.White : 內容_tb.ForeColor = Color.Black : 支付對象_tb.BackColor = Color.White : 支付對象_tb.ForeColor = Color.Black
  1747. 第二層_cb.BackColor = Color.White : 第二層_cb.ForeColor = Color.Black : 第三層_cb.BackColor = Color.White : 第三層_cb.ForeColor = Color.Black
  1748. 申請人_tb.BackColor = Color.White : 申請人_tb.ForeColor = Color.Black : 年份2_cb.BackColor = Color.White : 年份2_cb.ForeColor = Color.Black
  1749. 月份2_cb.BackColor = Color.White : 月份2_cb.ForeColor = Color.Black : 審核人_tb.BackColor = Color.White : 審核人_tb.ForeColor = Color.Black
  1750. 營行帳號_tb.BackColor = Color.White : 營行帳號_tb.ForeColor = Color.Black : 支付銀行_tb.BackColor = Color.White : 支付銀行_tb.ForeColor = Color.Black
  1751. 銀行支行_tb.BackColor = Color.White : 銀行支行_tb.ForeColor = Color.Black : 檢查人_tb.BackColor = Color.White : 檢查人_tb.ForeColor = Color.Black
  1752. 主管_tb.BackColor = Color.White : 主管_tb.ForeColor = Color.Black
  1753. 重選部門_bt.BackColor = Color.White : 開立收支單_bt.BackColor = Color.White : 申請完成_bt.BackColor = Color.White : 刪除收支單_bt.BackColor = Color.White
  1754. 列印成EXCEL_bt.BackColor = Color.White : 審核通過_bt.BackColor = Color.White : 單據作廢_bt.BackColor = Color.White : 檢查人_bt.BackColor = Color.White
  1755. 主管_bt.BackColor = Color.White
  1756. 財務收支單_dgv.EnableHeadersVisualStyles = True : 財務收支單_dgv.BackgroundColor = Color.White : 財務收支單_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black
  1757. 財務收支單_dgv.DefaultCellStyle.BackColor = Color.White : 財務收支單_dgv.DefaultCellStyle.ForeColor = Color.Black
  1758. Else
  1759. Me.BackColor = Color.Black
  1760. 財務單號_lb.ForeColor = Color.White : Label1.ForeColor = Color.White : Label2.ForeColor = Color.White : 補單_cb.ForeColor = Color.White
  1761. Label3.ForeColor = Color.White : Label4.ForeColor = Color.White : Label5.ForeColor = Color.White : 會計科目_lb.ForeColor = Color.White
  1762. Label6.ForeColor = Color.White : Label7.ForeColor = Color.White : Label8.ForeColor = Color.White : Label9.ForeColor = Color.White
  1763. Label10.ForeColor = Color.White : Label11.ForeColor = Color.White : Label12.ForeColor = Color.White : Label13.ForeColor = Color.White
  1764. Label14.ForeColor = Color.White : HX_ch.ForeColor = Color.White : PGS_ch.ForeColor = Color.White : ALL_ch.ForeColor = Color.White
  1765. Label18.ForeColor = Color.White : Label17.ForeColor = Color.White : Label15.ForeColor = Color.White : Label16.ForeColor = Color.White
  1766. Label19.ForeColor = Color.White
  1767. 單號_tb.BackColor = Color.DimGray : 單號_tb.ForeColor = Color.White : 部門選單_cb.BackColor = Color.DimGray : 部門選單_cb.ForeColor = Color.White
  1768. 申請金額_nud.BackColor = Color.DimGray : 申請金額_nud.ForeColor = Color.White : 金額大寫_tb.BackColor = Color.DimGray : 金額大寫_tb.ForeColor = Color.White
  1769. 內容_tb.BackColor = Color.DimGray : 內容_tb.ForeColor = Color.White : 支付對象_tb.BackColor = Color.DimGray : 支付對象_tb.ForeColor = Color.White
  1770. 第二層_cb.BackColor = Color.DimGray : 第二層_cb.ForeColor = Color.White : 第三層_cb.BackColor = Color.DimGray : 第三層_cb.ForeColor = Color.White
  1771. 申請人_tb.BackColor = Color.DimGray : 申請人_tb.ForeColor = Color.White : 年份2_cb.BackColor = Color.DimGray : 年份2_cb.ForeColor = Color.White
  1772. 月份2_cb.BackColor = Color.DimGray : 月份2_cb.ForeColor = Color.White : 審核人_tb.BackColor = Color.DimGray : 審核人_tb.ForeColor = Color.White
  1773. 營行帳號_tb.BackColor = Color.DimGray : 營行帳號_tb.ForeColor = Color.White : 支付銀行_tb.BackColor = Color.DimGray : 支付銀行_tb.ForeColor = Color.White
  1774. 銀行支行_tb.BackColor = Color.DimGray : 銀行支行_tb.ForeColor = Color.White : 檢查人_tb.BackColor = Color.DimGray : 檢查人_tb.ForeColor = Color.White
  1775. 主管_tb.BackColor = Color.DimGray : 主管_tb.ForeColor = Color.White
  1776. 重選部門_bt.BackColor = Color.DimGray : 開立收支單_bt.BackColor = Color.DimGray : 申請完成_bt.BackColor = Color.DimGray : 刪除收支單_bt.BackColor = Color.DimGray
  1777. 列印成EXCEL_bt.BackColor = Color.DimGray : 審核通過_bt.BackColor = Color.DimGray : 單據作廢_bt.BackColor = Color.DimGray : 檢查人_bt.BackColor = Color.DimGray
  1778. 主管_bt.BackColor = Color.DimGray
  1779. 財務收支單_dgv.EnableHeadersVisualStyles = False : 財務收支單_dgv.BackgroundColor = Color.DimGray : 財務收支單_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White
  1780. 財務收支單_dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.Black : 財務收支單_dgv.DefaultCellStyle.BackColor = Color.Black
  1781. 財務收支單_dgv.DefaultCellStyle.ForeColor = Color.White
  1782. End If
  1783. End Sub
  1784. End Class