No Description
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 149KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400
  1. Option Strict Off
  2. Imports Microsoft.Office.Interop.Excel.XlUnderlineStyle
  3. Imports Microsoft.Office.Interop.Excel.Constants
  4. Imports Microsoft.Office.Interop.Excel.XlBordersIndex
  5. Imports Microsoft.Office.Interop.Excel.XlLineStyle
  6. Imports Microsoft.Office.Interop.Excel.XlBorderWeight
  7. Imports Microsoft.Office.Interop.Excel.XlThemeFont
  8. Imports Microsoft.Office.Interop.Excel.XlThemeColor
  9. Imports Microsoft.Office.Interop.Excel.XlWindowState
  10. Imports Microsoft.Office.Interop.Excel
  11. Public Class 財物支付單申請_傳票
  12. Dim SK1, SK2 As String : Dim 不可編輯x As Boolean
  13. Dim 新項次 As String : Dim 新流水1 As String
  14. Dim 匯率1 As Double : Private ReadOnly 對話框(15) As String
  15. Dim xlApp As Application
  16. Dim xlBook As Workbook
  17. Dim xlSheet As Worksheet
  18. Private Sub 語言轉換讀取()
  19. If 系統語言 = "繁體中文" Then : 語言 = "CH" : ElseIf 系統語言 = "English" Then : 語言 = "EN" : ElseIf 系統語言 = "Indonesian" Then : 語言 = "IN" : End If
  20. If 跨部門開啟 = False Then : Me.Text = 系統語言字典("H001-112-" & 語言) : Else : Me.Text = 系統語言字典("H001-113-" & 語言) : End If
  21. 財務單號_lb.Text = 系統語言字典("H301-129-" & 語言) : Label1.Text = 系統語言字典("H314-100-" & 語言) : Label2.Text = 系統語言字典("H314-101-" & 語言)
  22. Label3.Text = 系統語言字典("H314-102-" & 語言) : Label4.Text = 系統語言字典("H314-103-" & 語言) : Label5.Text = 系統語言字典("H314-104-" & 語言)
  23. Label6.Text = 系統語言字典("H314-105-" & 語言) : 會計科目_lb.Text = 系統語言字典("H301-120-" & 語言) : 表頭(113) = 系統語言字典("H204-120-" & 語言)
  24. 表頭(112) = 系統語言字典("H301-107-" & 語言) : 表頭(39) = 系統語言字典("H301-134-" & 語言) : 表頭(111) = 系統語言字典("H301-108-" & 語言)
  25. 表頭(20) = 系統語言字典("H301-110-" & 語言) : 表頭(107) = 系統語言字典("H301-111-" & 語言) : 表頭(109) = 系統語言字典("H301-109-" & 語言)
  26. 表頭(11) = 系統語言字典("H301-112-" & 語言) : 表頭(114) = 系統語言字典("H301-113-" & 語言) : 表頭(98) = 系統語言字典("H301-114-" & 語言)
  27. 表頭(115) = 系統語言字典("H301-116-" & 語言) : 表頭(108) = 系統語言字典("H301-117-" & 語言) : 表頭(110) = 系統語言字典("H301-115-" & 語言)
  28. Label8.Text = 系統語言字典("H314-106-" & 語言) : Label9.Text = 系統語言字典("H314-107-" & 語言) : Label10.Text = 系統語言字典("H314-108-" & 語言)
  29. Label11.Text = 系統語言字典("H314-109-" & 語言) : Label12.Text = 系統語言字典("H314-110-" & 語言) : 對話框(2) = 系統語言字典("H301-125-" & 語言)
  30. 對話框(3) = 系統語言字典("G000-117-" & 語言) : 對話框(1) = 系統語言字典("H301-124-" & 語言) : 表頭(1) = 系統語言字典("H314-106-" & 語言)
  31. 對話框(4) = 系統語言字典("H301-127-" & 語言) : 對話框(5) = 系統語言字典("H302-119-" & 語言) : 對話框(6) = 系統語言字典("H302-120-" & 語言)
  32. 對話框(7) = 系統語言字典("H302-121-" & 語言) : 表頭(2) = 系統語言字典("H507-121-" & 語言) : 表頭(3) = 系統語言字典("H314-111-" & 語言)
  33. 對話框(8) = 系統語言字典("H314-112-" & 語言) : Label18.Text = 系統語言字典("H314-113-" & 語言) : Label15.Text = 系統語言字典("H314-114-" & 語言)
  34. Label17.Text = 系統語言字典("H314-115-" & 語言) : Label16.Text = 系統語言字典("H314-116-" & 語言)
  35. End Sub
  36. Private Sub Set_清單1()
  37. Dim ds1 As New DataSet : 財務收支單_dgv.DataSource = Nothing : ds1.Clear()
  38. 財務收支單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  39. 財務收支單_dgv.ColumnHeadersHeight = 40 : 財務收支單_dgv.AllowUserToAddRows = False
  40. If 跨部門開啟 = False Then : PA25 = 部門選單_cb.Text & SK2 & SK1 & 年份2_cb.Text : SQL_財物支付單申請_查詢財務收支控制表() : Else : SQL_財物支付單申請_查詢財務收支控制表1() : End If
  41. da.Fill(ds1) : 財務收支單_dgv.DataSource = ds1.Tables(0) : conn.Close()
  42. 財務收支單_dgv.Columns(0).FillWeight = 125 : 財務收支單_dgv.Columns(1).FillWeight = 75 : 財務收支單_dgv.Columns(2).FillWeight = 120
  43. 財務收支單_dgv.Columns(11).FillWeight = 40 : 財務收支單_dgv.Columns(12).FillWeight = 40
  44. 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
  45. 財務收支單_dgv.Columns(0).ReadOnly = True : 財務收支單_dgv.Columns(1).ReadOnly = True : 財務收支單_dgv.Columns(2).ReadOnly = True
  46. For I As Integer = 0 To 財務收支單_dgv.Rows.Count - 1
  47. 財務收支單_dgv.Rows(I).Cells(11).Value = False : 財務收支單_dgv.Rows(I).Cells(12).Value = False
  48. If Strings.Left(財務收支單_dgv.Rows(I).Cells(10).Value.ToString, 2) = "作廢" Then : 財務收支單_dgv.Rows(I).Cells(12).Value = True
  49. ElseIf Strings.Left(財務收支單_dgv.Rows(I).Cells(10).Value.ToString, 2) <> "" Then : 財務收支單_dgv.Rows(I).Cells(11).Value = True : End If
  50. Next
  51. End Sub
  52. Private Sub 部門選單下拉清單讀取()
  53. SQL_部門選單() : 部門選單_cb.Items.Clear() : While (dr.Read()) : 部門選單_cb.Items.Add(dr("部門")) : End While : conn.Close()
  54. End Sub
  55. Private Sub 第三層下拉表單資料載入()
  56. PA26 = 編號2_cb.Text : SQL_財務單會計科目3() : 第三層_cb.Items.Clear() : 編號3_cb.Items.Clear() : 第三層_cb.Items.Add("") : 編號3_cb.Items.Add("")
  57. While (dr.Read()) : 第三層_cb.Items.Add(dr("會計科目")) : 編號3_cb.Items.Add(dr("編號")) : End While : conn.Close()
  58. If 第三層_cb.Items.Count <> 0 Then : 第三層_cb.SelectedIndex = 0 : End If
  59. End Sub
  60. Private Sub 第一層下拉表單資料載入()
  61. SQL_財務單會計科目1() : 第一層_cb.Items.Clear() : 編號1_cb.Items.Clear()
  62. While (dr.Read()) : 第一層_cb.Items.Add(dr("第一階")) : 編號1_cb.Items.Add(dr("編號")) : End While : conn.Close() : 第一層_cb.Text = "" : 編號1_cb.Text = ""
  63. End Sub
  64. Private Sub 第二層下拉表單資料載入()
  65. PA25 = 編號1_cb.Text : SQL_財務單會計科目2() : 第二層_cb.Items.Clear() : 編號2_cb.Items.Clear() : 第二層_cb.Items.Add("") : 編號2_cb.Items.Add("")
  66. While (dr.Read()) : 第二層_cb.Items.Add(dr("第二階")) : 編號2_cb.Items.Add(dr("編號")) : End While : conn.Close() : 第二層_cb.Text = "" : 編號2_cb.Text = ""
  67. End Sub
  68. Private Sub 匯率()
  69. SQL_營運成本收支單申請_查詢匯率()
  70. If dr.Read() Then
  71. 人民幣匯率_tb.Text = dr("中心匯率").ToString : 美金匯率_tb.Text = dr("美金匯率").ToString : 印尼匯率_tb.Text = dr("印尼盾").ToString : conn.Close() : dr.Close()
  72. Else : 人民幣匯率_tb.Text = "4.5" : 美金匯率_tb.Text = dr("美金匯率").ToString : 印尼匯率_tb.Text = dr("印尼盾").ToString : End If
  73. End Sub
  74. Private Sub Set_切換格式()
  75. 明細_dgv.DataSource = Nothing : 單號_tb.Text = "" : 申請人_tb.Text = ""
  76. 第三層下拉表單資料載入() : Set_清單1()
  77. End Sub
  78. Private Sub 財物支付單申請_傳票_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  79. If 跨部門開啟 = False Then : Me.AutoScroll = True : 首次開啟 = True : 申請_p.Visible = True : 審核_p.Visible = False
  80. ElseIf 跨部門開啟 = True Then : Me.MdiParent = HX_PGS_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True : 首次開啟 = True : 申請_p.Visible = False : 審核_p.Visible = True : End If
  81. 年份2_cb.Text = Year(Today) : 月份2_cb.SelectedIndex = Month(Today) - 1 : Panel1.SendToBack() : 第一層下拉表單資料載入()
  82. H(314) = True : 介面 = "H314" : 語言轉換讀取() : 顯示說明(999, False)
  83. MyMod.清單字體大小調整()
  84. 財務收支單_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  85. End Sub
  86. Private Sub 財物支付單申請_傳票_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
  87. 部門選單下拉清單讀取()
  88. If 跨部門開啟 = False Then : CB選擇清單(部門選單_cb, 部門選單_cb.Text) : CB選擇清單(選擇公司_cb, 選擇公司_cb.Text) : Else : End If : Set_清單1()
  89. If PA48 = "採購" Then : 匯率() : 開立收支單_bt.Visible = False : 申請完成_bt.Visible = False : 首次開啟 = False
  90. Else : 匯率() : 幣別_cb.SelectedIndex = 3 : 編號1_cb.Text = "B-02" : 首次開啟 = False : End If : PA48 = ""
  91. End Sub
  92. Private Sub 財物支付單申請_傳票_Closed(sender As Object, e As EventArgs) Handles MyBase.Closed
  93. H(314) = False : 跨部門開啟 = False : MyMod.虛擬桌面開啟()
  94. End Sub
  95. Private Sub 語轉扭_bt_Click(sender As Object, e As EventArgs) Handles 語轉扭_bt.Click
  96. 介面 = "H314" : 語言轉換讀取() : Set_清單1() : 第一層下拉表單資料載入() : 幣別_cb.SelectedIndex = 3 : 編號1_cb.Text = "B-02" : Set_清單1()
  97. End Sub
  98. Private Sub 登入閒置控制_MouseMove(sender As Object, e As EventArgs) Handles MyBase.MouseMove
  99. timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
  100. End Sub
  101. Private Sub 登入閒置控制_KeyPress(sender As Object, e As EventArgs) Handles MyBase.KeyPress
  102. timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
  103. End Sub
  104. Private Sub 財務收支單_dgv_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles 財務收支單_dgv.CellClick
  105. If e.RowIndex = -1 Then : Else
  106. 單號_tb.Text = 財務收支單_dgv(0, e.RowIndex).Value.ToString : 申請日期_dtp.Value = 財務收支單_dgv(1, e.RowIndex).Value.ToString
  107. 申請人_tb.Text = 財務收支單_dgv(2, e.RowIndex).Value.ToString : 系統單號_bt.Text = 財務收支單_dgv(3, e.RowIndex).Value.ToString
  108. 幣別_cb.Text = 財務收支單_dgv(4, e.RowIndex).Value.ToString : 編號1_cb.Text = Strings.Left(財務收支單_dgv("類別", e.RowIndex).Value.ToString, 4)
  109. 編號2_cb.Text = Strings.Left(財務收支單_dgv("類別", e.RowIndex).Value.ToString, 7) : 編號3_cb.Text = 財務收支單_dgv("類別", e.RowIndex).Value.ToString
  110. 金額大寫_tb.Text = 財務收支單_dgv("大寫", e.RowIndex).Value.ToString : 部門選單_cb.Text = Strings.Mid(財務收支單_dgv(0, e.RowIndex).Value.ToString, 5, 3)
  111. 內容_tb.Text = 財務收支單_dgv("明細", e.RowIndex).Value.ToString : 支付對象_tb.Text = 財務收支單_dgv("支付對象", e.RowIndex).Value.ToString
  112. 營行帳號_tb.Text = 財務收支單_dgv("公司", e.RowIndex).Value.ToString : 支付銀行_tb.Text = 財務收支單_dgv("付款銀行", e.RowIndex).Value.ToString
  113. 銀行支行_tb.Text = 財務收支單_dgv("銀行支行", e.RowIndex).Value.ToString
  114. If 財務收支單_dgv(11, e.RowIndex).Value = True Or 財務收支單_dgv(12, e.RowIndex).Value = True Then : 不可編輯x = True : Else : 不可編輯x = False : End If
  115. If Strings.Left(財務收支單_dgv.Rows(e.RowIndex).Cells(10).Value.ToString, 2) = "作廢" Then
  116. 審核人_tb.Text = 系統語言字典("H314-111-" & 語言) & Strings.Mid(財務收支單_dgv("審核人", e.RowIndex).Value.ToString, 3, 50)
  117. Else : 審核人_tb.Text = 財務收支單_dgv("審核人", e.RowIndex).Value.ToString : End If
  118. 申請金額_nud.Value = CLng(財務收支單_dgv("支出", e.RowIndex).Value.ToString) : 大寫轉換()
  119. End If
  120. End Sub
  121. Private Sub ComboBox5_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 第一層_cb.TextChanged
  122. 編號1_cb.SelectedIndex = 第一層_cb.SelectedIndex : 查詢_tb.Text = "" : 第二層下拉表單資料載入() : 第三層下拉表單資料載入()
  123. End Sub
  124. Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 編號1_cb.TextChanged
  125. 第一層_cb.SelectedIndex = 編號1_cb.SelectedIndex : 第二層下拉表單資料載入() : 第三層下拉表單資料載入()
  126. End Sub
  127. Private Sub ComboBox3_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 第二層_cb.TextChanged
  128. 編號2_cb.SelectedIndex = 第二層_cb.SelectedIndex : 第三層下拉表單資料載入()
  129. End Sub
  130. Private Sub ComboBox4_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 編號2_cb.TextChanged
  131. 第二層_cb.SelectedIndex = 編號2_cb.SelectedIndex : 第三層下拉表單資料載入()
  132. End Sub
  133. Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 第三層_cb.SelectedIndexChanged
  134. 編號3_cb.SelectedIndex = 第三層_cb.SelectedIndex
  135. End Sub
  136. Private Sub ComboBox6_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 編號3_cb.SelectedIndexChanged
  137. 第三層_cb.SelectedIndex = 編號3_cb.SelectedIndex
  138. End Sub
  139. Private Sub 部門選單_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 部門選單_cb.SelectedIndexChanged
  140. If 首次開啟 = False Then : Set_清單1() : End If
  141. End Sub
  142. Private Sub 部門選單_cb_Click(sender As Object, e As EventArgs) Handles 部門選單_cb.Click
  143. CB選擇清單(部門選單_cb, 部門選單_cb.Text)
  144. End Sub
  145. Private Sub 重選部門_bt_Click(sender As Object, e As EventArgs) Handles 重選部門_bt.Click
  146. CB選擇清單(部門選單_cb, 部門選單_cb.Text) : CB選擇清單(選擇公司_cb, 選擇公司_cb.Text)
  147. End Sub
  148. Private Sub 第二層_cb_Click(sender As Object, e As EventArgs) Handles 第二層_cb.Click
  149. CB選擇清單(第二層_cb, 第二層_cb.Text)
  150. End Sub
  151. Private Sub 第三層_cb_Click(sender As Object, e As EventArgs) Handles 第三層_cb.Click
  152. CB選擇清單(第三層_cb, 第三層_cb.Text)
  153. End Sub
  154. Private Sub 選擇公司_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 選擇公司_cb.SelectedIndexChanged
  155. If 選擇公司_cb.Text = "PT HONG XHE INDUSTRIAL" Then : PictureBox1.BringToFront() : SK2 = "/HXI-PP/" : Else : PictureBox1.SendToBack() : SK2 = "/PGS-PP/" : End If
  156. If 首次開啟 = False Then : Set_清單1() : End If
  157. End Sub
  158. Private Sub 申請日期_dtp_ValueChanged(sender As Object, e As EventArgs) Handles 申請日期_dtp.ValueChanged
  159. 匯率()
  160. End Sub
  161. Private Sub 年份2_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 年份2_cb.SelectedIndexChanged
  162. If 首次開啟 = False Then : Set_清單1() : End If
  163. End Sub
  164. Private Sub 年份2_cb_Click(sender As Object, e As EventArgs) Handles 年份2_cb.Click
  165. CB選擇清單(年份2_cb, 年份2_cb.Text)
  166. End Sub
  167. Private Sub 月份2_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 月份2_cb.SelectedIndexChanged
  168. If 月份2_cb.Text = "01" Then : SK1 = "I/" : ElseIf 月份2_cb.Text = "02" Then : SK1 = "II/" : ElseIf 月份2_cb.Text = "03" Then : SK1 = "III/"
  169. ElseIf 月份2_cb.Text = "04" Then : SK1 = "IV/" : ElseIf 月份2_cb.Text = "05" Then : SK1 = "V/" : ElseIf 月份2_cb.Text = "06" Then : SK1 = "VI/"
  170. ElseIf 月份2_cb.Text = "07" Then : SK1 = "VII/" : ElseIf 月份2_cb.Text = "08" Then : SK1 = "VIII/" : ElseIf 月份2_cb.Text = "09" Then : SK1 = "IX/"
  171. 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
  172. If 首次開啟 = False Then : Set_清單1() : End If
  173. End Sub
  174. Private Sub 月份2_cb_Click(sender As Object, e As EventArgs) Handles 月份2_cb.Click
  175. CB選擇清單(月份2_cb, 月份2_cb.Text)
  176. End Sub
  177. Private Sub Set_日期格式轉換()
  178. If 補單_cb.Checked = False Then : DTP = Strings.Format(Today(), "yyyy/MM/dd") : DTP1 = Strings.Format(Today(), "yyyyMMdd")
  179. Else : DTP1 = Strings.Format(申請日期_dtp.Value, "yyyyMMdd") : DTP = Strings.Format(申請日期_dtp.Value, "yyyy/MM/dd") : End If
  180. End Sub
  181. Private Sub Set_流水號()
  182. Dim NUM1 As Integer
  183. For NUM1 = 0 To 99
  184. Dim d As String : Dim f As String : Dim g As Integer = 1
  185. If Month(Now) < 10 Then : d = "0" & CStr(Month(Now)) : Else : d = CStr(Month(Now)) : End If
  186. If Now.Day() < 10 Then : f = "0" & CStr(Now.Day()) : Else : f = CStr(Now.Day()) : End If
  187. If NUM1 < 10 Then : 新流水1 = "B" & Microsoft.VisualBasic.Right(CStr(Year(Now)), 2) & d & f & "0" & NUM1
  188. Else : 新流水1 = "B" & Microsoft.VisualBasic.Right(CStr(Year(Now)), 2) & d & f & NUM1 : End If : PA19 = 新流水1
  189. SQL_營運成本收支單申請_查詢收支單公帳流水號()
  190. If dr.Read() Then : conn.Close() : Else : conn.Close() : NUM1 = 99 : End If
  191. Next
  192. End Sub
  193. Private Sub 開立收支單_bt_Click(sender As Object, e As EventArgs) Handles 開立收支單_bt.Click
  194. If 編號3_cb.Text = "" Or 幣別_cb.Text = "" Then : MGB(對話框(2), 1) : 首次開啟 = False : Else : 不可編輯x = False
  195. If 補單_cb.Checked = False Then : 申請日期_dtp.Value = Today() : End If : 申請人_tb.Text = gUserName
  196. Dim NUM1 As Integer
  197. Set_日期格式轉換()
  198. For i As Integer = 1 To 999
  199. NUM1 = 0 + i
  200. If NUM1 < 10 Then : 系統單號_bt.Text = "OE-" & DTP1 & "-00" & NUM1
  201. ElseIf NUM1 > 9 And NUM1 < 100 Then : 系統單號_bt.Text = "OE-" & DTP1 & "-0" & NUM1
  202. ElseIf NUM1 > 99 Then : 系統單號_bt.Text = "OE-" & DTP1 & "-" & NUM1
  203. End If : conn.Close() : PA = 系統單號_bt.Text : PA15 = 系統單號_bt.Text
  204. SQL_營運成本收支單申請_查詢第一筆公帳支付單號()
  205. If dr.Read() Then : Else : i = 999 : conn.Close() : End If : conn.Close()
  206. Next : SQL_營運成本收支單申請_新增一筆財務收支控制表() : conn.Close() : 申請人_tb.Text = gUserName
  207. 月份2_cb.Text = Strings.Mid(Strings.Format(申請日期_dtp.Value, "yyyy/MM/dd"), 6, 2)
  208. PA25 = 部門選單_cb.Text & SK2 & SK1 & 年份2_cb.Text : SQL_財物支付單申請_查詢最後一筆公帳支付單號()
  209. If dr.Read() Then : 單號_tb.Text = Strings.Left(dr("流水號").ToString, 3) : Else : 單號_tb.Text = "000" : End If : conn.Close()
  210. 單號_tb.Text = CInt(單號_tb.Text) + 1
  211. If CInt(單號_tb.Text) < 10 Then : 單號_tb.Text = "00" & CInt(單號_tb.Text)
  212. ElseIf CInt(單號_tb.Text) > 9 And CInt(單號_tb.Text) < 100 Then : 單號_tb.Text = "0" & CInt(單號_tb.Text)
  213. ElseIf CInt(單號_tb.Text) > 99 And CInt(單號_tb.Text) < 1000 Then : 單號_tb.Text = CInt(單號_tb.Text) : End If
  214. 單號_tb.Text = 單號_tb.Text & "-" & 部門選單_cb.Text & SK2 & SK1 & 年份2_cb.Text : PA19 = 單號_tb.Text : 新項次 = "01" : PA11 = 新項次
  215. 指定會科 = 編號3_cb.Text : PA13 = "0" : PA14 = 申請金額_nud.Value : PA12 = 內容_tb.Text : PA37 = "" : PA38 = 金額大寫_tb.Text : PA39 = 支付對象_tb.Text
  216. PA40 = 營行帳號_tb.Text : PA41 = 支付銀行_tb.Text : PA42 = 銀行支行_tb.Text
  217. If 幣別_cb.Text = "TWD" Then : 匯率1 = 1 / CDbl(印尼匯率_tb.Text)
  218. ElseIf 幣別_cb.Text = "RMB" Then : 匯率1 = CDbl(人民幣匯率_tb.Text) / CDbl(印尼匯率_tb.Text)
  219. ElseIf 幣別_cb.Text = "USD" Then : 匯率1 = CDbl(美金匯率_tb.Text) / CDbl(印尼匯率_tb.Text)
  220. ElseIf 幣別_cb.Text = "IDR" Then : 匯率1 = 1
  221. End If : PA16 = 匯率1
  222. SQL_新增財物支付單明細表資料() : Set_清單1()
  223. End If
  224. End Sub
  225. Private Sub 開立收支單1_bt_Click(sender As Object, e As EventArgs) Handles 開立收支單1_bt.Click
  226. If 編號3_cb.Text = "" Or 幣別_cb.Text = "" Then : MGB(對話框(2), 1) : 首次開啟 = False : Else : 不可編輯x = False
  227. If 補單_cb.Checked = False Then : 申請日期_dtp.Value = Today() : End If : 申請人_tb.Text = gUserName
  228. Dim NUM1 As Integer
  229. Set_日期格式轉換()
  230. For i As Integer = 1 To 999
  231. NUM1 = 0 + i
  232. If NUM1 < 10 Then : 系統單號_bt.Text = "OE-" & DTP1 & "-00" & NUM1
  233. ElseIf NUM1 > 9 And NUM1 < 100 Then : 系統單號_bt.Text = "OE-" & DTP1 & "-0" & NUM1
  234. ElseIf NUM1 > 99 Then : 系統單號_bt.Text = "OE-" & DTP1 & "-" & NUM1
  235. End If : conn.Close() : PA = 系統單號_bt.Text : PA15 = 系統單號_bt.Text
  236. SQL_營運成本收支單申請_查詢第一筆公帳支付單號()
  237. If dr.Read() Then : Else : i = 999 : conn.Close() : End If : conn.Close()
  238. Next
  239. SQL_營運成本收支單申請_新增一筆財務收支控制表() : conn.Close() : 申請人_tb.Text = gUserName
  240. 月份2_cb.Text = Strings.Mid(Strings.Format(申請日期_dtp.Value, "yyyy/MM/dd"), 6, 2)
  241. PA25 = 部門選單_cb.Text & SK2 & SK1 & 年份2_cb.Text : SQL_財物支付單申請_查詢最後一筆公帳支付單號()
  242. If dr.Read() Then : 單號_tb.Text = Strings.Left(dr("流水號").ToString, 3) : Else : 單號_tb.Text = "000" : End If : conn.Close()
  243. 單號_tb.Text = CInt(單號_tb.Text) + 1
  244. If CInt(單號_tb.Text) < 10 Then : 單號_tb.Text = "00" & CInt(單號_tb.Text)
  245. ElseIf CInt(單號_tb.Text) > 9 And CInt(單號_tb.Text) < 100 Then : 單號_tb.Text = "0" & CInt(單號_tb.Text)
  246. ElseIf CInt(單號_tb.Text) > 99 And CInt(單號_tb.Text) < 1000 Then : 單號_tb.Text = CInt(單號_tb.Text) : End If
  247. 單號_tb.Text = 單號_tb.Text & "-" & 部門選單_cb.Text & SK2 & SK1 & 年份2_cb.Text : PA19 = 單號_tb.Text : 新項次 = "01" : PA11 = 新項次
  248. 指定會科 = 編號3_cb.Text : PA13 = "0" : PA14 = 申請金額_nud.Value : PA12 = 內容_tb.Text : PA37 = "" : PA38 = 金額大寫_tb.Text : PA39 = 支付對象_tb.Text
  249. PA40 = 營行帳號_tb.Text : PA41 = 支付銀行_tb.Text : PA42 = 銀行支行_tb.Text
  250. If 幣別_cb.Text = "TWD" Then : 匯率1 = 1 / CDbl(印尼匯率_tb.Text)
  251. ElseIf 幣別_cb.Text = "RMB" Then : 匯率1 = CDbl(人民幣匯率_tb.Text) / CDbl(印尼匯率_tb.Text)
  252. ElseIf 幣別_cb.Text = "USD" Then : 匯率1 = CDbl(美金匯率_tb.Text) / CDbl(印尼匯率_tb.Text)
  253. ElseIf 幣別_cb.Text = "IDR" Then : 匯率1 = 1
  254. End If : PA16 = 匯率1
  255. SQL_新增財物支付單明細表資料() : Set_清單1()
  256. End If
  257. End Sub
  258. Private Sub 刪除收支單_bt_Click(sender As Object, e As EventArgs) Handles 刪除收支單_bt.Click
  259. If 不可編輯x = False Then
  260. If 系統單號_bt.Text = "" Then : MGB(對話框(3), 1) : 首次開啟 = False : Else
  261. MGB(對話框(4), 2)
  262. If 訊息回應 = "YES" Then
  263. PA20 = 單號_tb.Text
  264. Dim ds1 As New DataSet : 採購連結_dgv.DataSource = Nothing : ds1.Clear()
  265. 採購連結_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  266. 採購連結_dgv.ColumnHeadersHeight = 40 : 採購連結_dgv.AllowUserToAddRows = False
  267. SQL_財務採購關聯表_反改查詢()
  268. da.Fill(ds1) : 採購連結_dgv.DataSource = ds1.Tables(0) : conn.Close()
  269. For I As Integer = 0 To 採購連結_dgv.Rows.Count - 1
  270. PA21 = 採購連結_dgv.Rows(I).Cells("採購單號").Value.ToString : SQL_採購單控制表_反改查詢()
  271. If dr.Read Then : PA22 = CLng(dr("轉財務金額").ToString) - CLng(採購連結_dgv.Rows(I).Cells("轉財務金額").Value.ToString) : End If
  272. SQL_採購單控制表_反改()
  273. Next
  274. SQL_財務採購關聯表_反改()
  275. PA45 = 系統單號_bt.Text : SQL_營運成本收支單申請_刪除財務收支控制表() : SQL_營運成本收支單申請_刪除財務收支明細表() : conn.Close()
  276. 第二層_cb.Text = "" : 編號2_cb.Text = "" : 第三層_cb.Text = "" : 編號3_cb.Text = "" : 申請金額_nud.Value = 0
  277. 單號_tb.Text = "" : 申請人_tb.Text = "" : 金額大寫_tb.Text = "" : 內容_tb.Text = "" : 支付對象_tb.Text = "" : Set_清單1()
  278. End If : 首次開啟 = False
  279. End If
  280. Else : MGB(對話框(8), 1) : 首次開啟 = False : End If
  281. End Sub
  282. Private Sub 申請完成_bt_Click(sender As Object, e As EventArgs) Handles 申請完成_bt.Click
  283. If 不可編輯x = False Then
  284. If 系統單號_bt.Text = "" Then : MGB(對話框(3), 1) : 首次開啟 = False : Else
  285. PA1 = 內容_tb.Text : PA2 = 申請金額_nud.Value : PA4 = 編號3_cb.Text : PA3 = 金額大寫_tb.Text : PA5 = 支付對象_tb.Text : PA6 = 系統單號_bt.Text : PA9 = "01"
  286. PA7 = 營行帳號_tb.Text : PA8 = 支付銀行_tb.Text : PA10 = 銀行支行_tb.Text
  287. SQL_財物支付單修改() : Set_清單1() : MGB(對話框(1), 1) : 首次開啟 = False
  288. End If
  289. Else
  290. If 登入人級別 = "00" Then
  291. PA1 = 內容_tb.Text : PA2 = 申請金額_nud.Value : PA4 = 編號3_cb.Text : PA3 = 金額大寫_tb.Text : PA5 = 支付對象_tb.Text : PA6 = 系統單號_bt.Text : PA9 = "01"
  292. PA7 = 營行帳號_tb.Text : PA8 = 支付銀行_tb.Text : PA10 = 銀行支行_tb.Text
  293. SQL_財物支付單修改() : Set_清單1() : MGB(對話框(1), 1) : 首次開啟 = False
  294. End If
  295. MGB(對話框(8), 1) : 首次開啟 = False
  296. End If
  297. End Sub
  298. Private Sub 審核通過_bt_Click(sender As Object, e As EventArgs) Handles 審核通過_bt.Click
  299. If 系統單號_bt.Text = "" Then : MGB(對話框(3), 1) : 首次開啟 = False : Else
  300. Set_日期格式轉換()
  301. PA27 = "" : PA28 = "" : PA29 = 系統單號_bt.Text
  302. SQL_營運成本收支單審核_修改財務收支控制表() : SQL_營運成本收支單審核_修改財務收支明細表() : conn.Close()
  303. PA1 = "01" : SQL_營運成本收支單審核_修改財務收支明細表備用金() : SQL_營運成本收支單審核_修改財務收支明細表現金() : SQL_營運成本收支單審核_修改財務收支明細表支出()
  304. MGB(對話框(5), 1) : 首次開啟 = False : Set_清單1()
  305. End If
  306. End Sub
  307. Private Sub 單據作廢_bt_Click(sender As Object, e As EventArgs) Handles 單據作廢_bt.Click
  308. If 系統單號_bt.Text = "" Then : MGB(對話框(3), 1) : 首次開啟 = False : Else : INB(對話框(6)) : PA = 訊息回應
  309. If PA = "" Then : MGB(對話框(7), 1) : Else : Set_日期格式轉換()
  310. PA42 = 系統單號_bt.Text : SQL_營運成本收支單審核_審核人3() : conn.Close() : MGB(對話框(5), 1) : PA = "" : 首次開啟 = False : Set_清單1()
  311. End If
  312. End If
  313. End Sub
  314. Private Sub 申請金額_nud_ValueChanged(sender As Object, e As EventArgs) Handles 申請金額_nud.ValueChanged
  315. 大寫轉換()
  316. End Sub
  317. Private Sub 大寫轉換()
  318. Dim 個位(20), 十位(9), 百位(1), 千位(1), 百萬, 十億, 零, 拾, 百, 仟, 萬, 億, 兆, 答案 As String : Dim 數長 As Integer
  319. 答案 = "" : 零 = "" : 拾 = "" : 百 = "" : 仟 = "" : 萬 = "" : 百萬 = "" : 億 = "" : 十億 = "" : 兆 = ""
  320. If 系統語言 = "繁體中文" Then
  321. 個位(0) = "零" : 個位(1) = "壹" : 個位(2) = "貳" : 個位(3) = "參" : 個位(4) = "肆" : 個位(5) = "伍" : 個位(6) = "陸" : 個位(7) = "柒" : 個位(8) = "捌" : 個位(9) = "玖"
  322. 零 = "零" : 拾 = "拾" : 百 = "百" : 仟 = "仟" : 萬 = "萬" : 億 = "億" : 兆 = "兆"
  323. ElseIf 系統語言 = "Indonesian" Then
  324. 個位(0) = "Nol" : 個位(1) = "Satu" : 個位(2) = "Dua" : 個位(3) = "Tiga" : 個位(4) = "Empat" : 個位(5) = "Lima" : 個位(6) = "Enam" : 個位(7) = "Tujuh"
  325. 個位(8) = "Delapan" : 個位(9) = "Sembilan" : 個位(10) = "Sepuluh" : 個位(11) = "Sebelas" : 個位(12) = "Dua Belas" : 個位(13) = "Tiga Belas" : 個位(14) = "Empat Belas"
  326. 個位(15) = "Lima Belas" : 個位(16) = "Enam Belas" : 個位(17) = "Tujuh Belas" : 個位(18) = "Delapan Belas" : 個位(19) = "Sembilan Belas" : 個位(20) = "Dua Puluh"
  327. 十位(1) = "Sepuluh" : 十位(2) = "Dua Puluh" : 十位(3) = "Tiga Puluh" : 十位(4) = "Empat Puluh" : 十位(5) = "Lima Puluh" : 十位(6) = "Enam Puluh" : 十位(7) = "Tujuh Puluh"
  328. 十位(8) = "Delapan Puluh" : 十位(9) = "Sembilan Puluh"
  329. 百位(0) = "Seratus" : 百位(1) = "Ratus" : 千位(0) = "Seribu" : 千位(1) = "Ribu" : 百萬 = "Juta" : 十億 = "Miliar" : 兆 = "Triliun"
  330. ElseIf 系統語言 = "English" Then
  331. 個位(0) = "Zero" : 個位(1) = "One" : 個位(2) = "Two" : 個位(3) = "Three" : 個位(4) = "Four" : 個位(5) = "Five" : 個位(6) = "Six" : 個位(7) = "Seven"
  332. 個位(8) = "Eight" : 個位(9) = "Nine" : 個位(10) = "Ten" : 個位(11) = "Eleven" : 個位(12) = "Twelve" : 個位(13) = "Thirteen" : 個位(14) = "Fourteen"
  333. 個位(15) = "Fifteen" : 個位(16) = "Sixteen" : 個位(17) = "Seventeen" : 個位(18) = "Eighteen" : 個位(19) = "Nineteen" : 個位(20) = "Twenty"
  334. 十位(1) = "Ten" : 十位(2) = "Twenty" : 十位(3) = "Thirty" : 十位(4) = "Forty" : 十位(5) = "Fifty" : 十位(6) = "Sixty" : 十位(7) = "Seventy" : 十位(8) = "Eighty"
  335. 十位(9) = "Ninety"
  336. 百位(0) = "One Hundred" : 百位(1) = "Hundred" : 千位(0) = "One Thousand" : 千位(1) = "Thousand" : 百萬 = "Million" : 十億 = "Billion" : 兆 = "Trillion"
  337. End If
  338. '--------------轉大寫-----------------------------------------------------------
  339. Dim 位數(13), 末位數 As String
  340. Dim NB As Long = 申請金額_nud.Value : Dim NBS As String = NB.ToString() : 數長 = NBS.Length
  341. 位數(1) = Strings.Left(NBS, 1) : 末位數 = Strings.Right(NBS, 1)
  342. If 數長 >= 2 Then : 位數(2) = Strings.Mid(NBS, 2, 1) : End If : If 數長 >= 3 Then : 位數(3) = Strings.Mid(NBS, 3, 1) : End If
  343. If 數長 >= 4 Then : 位數(4) = Strings.Mid(NBS, 4, 1) : End If : If 數長 >= 5 Then : 位數(5) = Strings.Mid(NBS, 5, 1) : End If
  344. If 數長 >= 6 Then : 位數(6) = Strings.Mid(NBS, 6, 1) : End If : If 數長 >= 7 Then : 位數(7) = Strings.Mid(NBS, 7, 1) : End If
  345. If 數長 >= 8 Then : 位數(8) = Strings.Mid(NBS, 8, 1) : End If : If 數長 >= 9 Then : 位數(9) = Strings.Mid(NBS, 9, 1) : End If
  346. If 數長 >= 10 Then : 位數(10) = Strings.Mid(NBS, 10, 1) : End If : If 數長 >= 11 Then : 位數(11) = Strings.Mid(NBS, 11, 1) : End If
  347. If 數長 >= 12 Then : 位數(12) = Strings.Mid(NBS, 12, 1) : End If : If 數長 >= 13 Then : 位數(13) = Strings.Mid(NBS, 13, 1) : End If
  348. If 系統語言 <> "繁體中文" Then
  349. If 申請金額_nud.Value < 21 Then : 答案 = 個位(申請金額_nud.Value)
  350. ElseIf 數長 = 2 Then
  351. If 位數(2) <> "0" And 末位數 = "0" Then : 答案 = 十位(位數(1))
  352. ElseIf 位數(2) <> "0" And 末位數 <> "0" Then : 答案 = 十位(位數(1)) & " " & 個位(末位數) : End If
  353. ElseIf 數長 = 3 Then
  354. '------------------百------------------------------------------------------------------------------------------------------
  355. If 位數(1) = "1" Then : 答案 = 百位(0) : ElseIf 位數(1) <> "1" Then : 答案 = 個位(位數(1)) & " " & 百位(1) : End If
  356. '------------------個十------------------------------------------------------------------------------------------------------
  357. If 位數(2) = "0" And 末位數 = "0" Then
  358. ElseIf 位數(2) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  359. Else
  360. If CInt(位數(2) & 末位數) < 21 Then
  361. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(2)) : Else : 答案 &= " " & 個位(位數(2) & 末位數) : End If
  362. Else
  363. If 位數(2) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(2))
  364. ElseIf 位數(2) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 個位(末位數) : End If
  365. End If
  366. End If
  367. ElseIf 數長 = 4 Then
  368. '------------------千------------------------------------------------------------------------------------------------------
  369. If 位數(1) = "1" Then : 答案 = 千位(0)
  370. ElseIf 位數(1) <> "1" Then : 答案 = 個位(位數(1)) & " " & 千位(1) : End If
  371. '------------------百------------------------------------------------------------------------------------------------------
  372. If CInt(位數(2) & 位數(3) & 末位數) < 100 Then
  373. ElseIf CInt(位數(2) & 位數(3) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  374. ElseIf CInt(位數(2) & 位數(3) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(2)) & " " & 百位(1) : End If
  375. '------------------個十------------------------------------------------------------------------------------------------------
  376. If 位數(3) = "0" And 末位數 = "0" Then
  377. ElseIf 位數(3) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  378. Else
  379. If CInt(位數(3) & 末位數) < 21 Then
  380. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(3)) : Else : 答案 &= " " & 個位(位數(3) & 末位數) : End If
  381. Else
  382. If 位數(3) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(3))
  383. ElseIf 位數(3) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 個位(末位數) : End If
  384. End If
  385. End If
  386. ElseIf 數長 = 5 Then
  387. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  388. If CInt(位數(1) & 位數(2)) < 21 Then
  389. If 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 千位(1) : Else : 答案 = 個位(位數(1) & 位數(2)) & " " & 千位(1) : End If
  390. Else
  391. If 位數(1) <> "0" And 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 千位(1)
  392. ElseIf 位數(1) <> "0" And 位數(2) <> "0" Then : 答案 = 十位(位數(1)) & " " & 個位(位數(2)) & " " & 千位(1) : End If
  393. End If
  394. '------------------百------------------------------------------------------------------------------------------------------
  395. If CInt(位數(3) & 位數(4) & 末位數) < 100 Then
  396. ElseIf CInt(位數(3) & 位數(4) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  397. ElseIf CInt(位數(3) & 位數(4) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(3)) & " " & 百位(1) : End If
  398. '------------------個十------------------------------------------------------------------------------------------------------
  399. If 位數(4) = "0" And 末位數 = "0" Then
  400. ElseIf 位數(4) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  401. Else
  402. If CInt(位數(4) & 末位數) < 21 Then
  403. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(4)) : Else : 答案 &= " " & 個位(位數(4) & 末位數) : End If
  404. Else
  405. If 位數(4) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(4))
  406. ElseIf 位數(4) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 個位(末位數) : End If
  407. End If
  408. End If
  409. ElseIf 數長 = 6 Then
  410. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  411. If CInt(位數(1)) = 1 Then : 答案 = 百位(0) : Else : 答案 = 個位(位數(1)) & " " & 百位(1) : End If
  412. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  413. If CInt(位數(2) & 位數(3)) < 21 Then
  414. If 位數(3) = "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 千位(1) : Else : 答案 &= " " & 個位(位數(2) & 位數(3)) & " " & 千位(1) : End If
  415. Else
  416. If 位數(2) <> "0" And 位數(3) = "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 千位(1)
  417. ElseIf 位數(2) <> "0" And 位數(3) <> "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 個位(位數(3)) & " " & 千位(1) : End If
  418. End If
  419. '------------------百------------------------------------------------------------------------------------------------------
  420. If CInt(位數(4) & 位數(5) & 末位數) < 100 Then
  421. ElseIf CInt(位數(4) & 位數(5) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  422. ElseIf CInt(位數(4) & 位數(5) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(4)) & " " & 百位(1) : End If
  423. '------------------個十------------------------------------------------------------------------------------------------------
  424. If 位數(5) = "0" And 末位數 = "0" Then
  425. ElseIf 位數(5) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  426. Else
  427. If CInt(位數(5) & 末位數) < 21 Then
  428. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(5)) : Else : 答案 &= " " & 個位(位數(5) & 末位數) : End If
  429. Else
  430. If 位數(5) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(5))
  431. ElseIf 位數(5) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(5)) & " " & 個位(末位數) : End If
  432. End If
  433. End If
  434. ElseIf 數長 = 7 Then
  435. '------------------百萬------------------------------------------------------------------------------------------------------
  436. 答案 = 個位(位數(1)) & " " & 百萬
  437. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  438. If CInt(位數(2)) = 0 Then : ElseIf CInt(位數(2)) = 1 Then : 答案 &= " " & 百位(0)
  439. ElseIf CInt(位數(2)) > 1 Then : 答案 &= " " & 個位(位數(2)) & " " & 百位(1) : End If
  440. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  441. If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" Then : Else
  442. If CInt(位數(3) & 位數(4)) < 21 Then
  443. If 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= " " & 千位(1)
  444. ElseIf 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= " " & 個位(位數(4)) & " " & 千位(1)
  445. ElseIf 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 千位(1)
  446. ElseIf 位數(3) <> "0" And 位數(4) <> "0" Then : 答案 &= " " & 個位(位數(3) & 位數(4)) & " " & 千位(1) : End If
  447. Else
  448. If 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 千位(1)
  449. ElseIf 位數(3) <> "0" And 位數(4) <> "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 個位(位數(4)) & " " & 千位(1) : End If
  450. End If
  451. End If
  452. '------------------百------------------------------------------------------------------------------------------------------
  453. If CInt(位數(5) & 位數(6) & 末位數) < 100 Then
  454. ElseIf CInt(位數(5) & 位數(6) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  455. ElseIf CInt(位數(5) & 位數(6) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(5)) & " " & 百位(1) : End If
  456. '------------------個十------------------------------------------------------------------------------------------------------
  457. If 位數(6) = "0" And 末位數 = "0" Then
  458. ElseIf 位數(6) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  459. Else
  460. If CInt(位數(6) & 末位數) < 21 Then
  461. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(6)) : Else : 答案 &= " " & 個位(位數(6) & 末位數) : End If
  462. Else
  463. If 位數(6) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(6))
  464. ElseIf 位數(6) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(6)) & " " & 個位(末位數) : End If
  465. End If
  466. End If
  467. ElseIf 數長 = 8 Then
  468. '------------------十百萬(千萬)------------------------------------------------------------------------------------------------------
  469. If CInt(位數(1) & 位數(2)) < 21 Then
  470. If 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 百萬 : Else : 答案 = 個位(位數(1) & 位數(2)) & " " & 百萬 : End If
  471. Else
  472. If 位數(1) <> "0" And 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 百萬
  473. ElseIf 位數(1) <> "0" And 位數(2) <> "0" Then : 答案 = 十位(位數(1)) & " " & 個位(位數(2)) & " " & 百萬 : End If
  474. End If
  475. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  476. If CInt(位數(3)) = 0 Then : ElseIf CInt(位數(3)) = 1 Then : 答案 &= " " & 百位(0)
  477. ElseIf CInt(位數(3)) > 1 Then : 答案 &= " " & 個位(位數(3)) & " " & 百位(1) : End If
  478. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  479. If 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" Then : Else
  480. If CInt(位數(4) & 位數(5)) < 21 Then
  481. If 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= " " & 千位(1)
  482. ElseIf 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= " " & 個位(位數(5)) & " " & 千位(1)
  483. ElseIf 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 千位(1)
  484. ElseIf 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= " " & 個位(位數(4) & 位數(5)) & " " & 千位(1) : End If
  485. Else
  486. If 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 千位(1)
  487. ElseIf 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 個位(位數(5)) & " " & 千位(1) : End If
  488. End If
  489. End If
  490. '------------------百------------------------------------------------------------------------------------------------------
  491. If CInt(位數(6) & 位數(7) & 末位數) < 100 Then
  492. ElseIf CInt(位數(6) & 位數(7) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  493. ElseIf CInt(位數(6) & 位數(7) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(6)) & " " & 百位(1) : End If
  494. '------------------個十------------------------------------------------------------------------------------------------------
  495. If 位數(7) = "0" And 末位數 = "0" Then
  496. ElseIf 位數(7) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  497. Else
  498. If CInt(位數(7) & 末位數) < 21 Then
  499. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(7)) : Else : 答案 &= " " & 個位(位數(7) & 末位數) : End If
  500. Else
  501. If 位數(7) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(7))
  502. ElseIf 位數(7) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(7)) & " " & 個位(末位數) : End If
  503. End If
  504. End If
  505. ElseIf 數長 = 9 Then
  506. '------------------百百萬(億)------------------------------------------------------------------------------------------------------
  507. If CInt(位數(1)) = 1 Then : 答案 = 百位(0) : ElseIf CInt(位數(1)) > 1 Then : 答案 = 個位(位數(1)) & " " & 百位(1) : End If
  508. '------------------十百萬(千萬)------------------------------------------------------------------------------------------------------
  509. If 位數(2) = "0" And 位數(3) = "0" Then : 答案 &= " " & 百萬
  510. ElseIf 位數(2) = "0" And 位數(3) <> "0" Then : 答案 &= " " & 個位(位數(3)) & " " & 百萬
  511. ElseIf CInt(位數(2) & 位數(3)) < 21 Then
  512. If 位數(3) = "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 百萬 : Else : 答案 &= " " & 個位(位數(2) & 位數(3)) & " " & 百萬 : End If
  513. ElseIf CInt(位數(2) & 位數(3)) >= 21 Then
  514. If 位數(2) <> "0" And 位數(3) = "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 百萬
  515. ElseIf 位數(2) <> "0" And 位數(3) <> "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 個位(位數(3)) & " " & 百萬 : End If
  516. End If
  517. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  518. If CInt(位數(4)) = 0 Then : ElseIf CInt(位數(4)) = 1 Then : 答案 &= " " & 百位(0)
  519. ElseIf CInt(位數(4)) > 1 Then : 答案 &= " " & 個位(位數(4)) & " " & 百位(1) : End If
  520. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  521. If 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" Then : Else
  522. If CInt(位數(5) & 位數(6)) < 21 Then
  523. If 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= " " & 千位(1)
  524. ElseIf 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= " " & 個位(位數(6)) & " " & 千位(1)
  525. ElseIf 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= " " & 十位(位數(5)) & " " & 千位(1)
  526. ElseIf 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= " " & 個位(位數(5) & 位數(6)) & " " & 千位(1) : End If
  527. Else
  528. If 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= " " & 十位(位數(5)) & " " & 千位(1)
  529. ElseIf 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= " " & 十位(位數(5)) & " " & 個位(位數(6)) & " " & 千位(1) : End If
  530. End If
  531. End If
  532. '------------------百------------------------------------------------------------------------------------------------------
  533. If CInt(位數(7) & 位數(8) & 末位數) < 100 Then
  534. ElseIf CInt(位數(7) & 位數(8) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  535. ElseIf CInt(位數(7) & 位數(8) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(7)) & " " & 百位(1) : End If
  536. '------------------個十------------------------------------------------------------------------------------------------------
  537. If 位數(8) = "0" And 末位數 = "0" Then
  538. ElseIf 位數(8) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  539. Else
  540. If CInt(位數(8) & 末位數) < 21 Then
  541. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(8)) : Else : 答案 &= " " & 個位(位數(8) & 末位數) : End If
  542. Else
  543. If 位數(8) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(8))
  544. ElseIf 位數(8) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(8)) & " " & 個位(末位數) : End If
  545. End If
  546. End If
  547. ElseIf 數長 = 10 Then
  548. '------------------十億------------------------------------------------------------------------------------------------------
  549. 答案 = 個位(位數(1)) & " " & 十億
  550. '------------------百百萬(億)------------------------------------------------------------------------------------------------------
  551. If CInt(位數(2)) = 0 Then
  552. ElseIf CInt(位數(2)) = 1 Then : 答案 &= " " & 百位(0)
  553. ElseIf CInt(位數(2)) > 1 Then : 答案 &= " " & 個位(位數(2)) & " " & 百位(1) : End If
  554. '------------------十百萬(千萬)------------------------------------------------------------------------------------------------------
  555. If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" Then
  556. ElseIf 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= " " & 百萬
  557. ElseIf 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= " " & 個位(位數(4)) & " " & 百萬
  558. ElseIf CInt(位數(3) & 位數(4)) < 21 Then
  559. If 位數(4) = "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 百萬 : Else : 答案 &= " " & 個位(位數(3) & 位數(4)) & " " & 百萬 : End If
  560. ElseIf CInt(位數(3) & 位數(4)) >= 21 Then
  561. If 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 百萬
  562. ElseIf 位數(3) <> "0" And 位數(4) <> "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 個位(位數(4)) & " " & 百萬 : End If
  563. End If
  564. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  565. If CInt(位數(5)) = 0 Then : ElseIf CInt(位數(5)) = 1 Then : 答案 &= " " & 百位(0)
  566. ElseIf CInt(位數(5)) > 1 Then : 答案 &= " " & 個位(位數(5)) & " " & 百位(1) : End If
  567. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  568. If CInt(位數(6) & 位數(7)) < 21 Then
  569. If 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" Then
  570. ElseIf 位數(6) = "0" And 位數(7) = "0" Then : 答案 &= " " & 千位(1)
  571. ElseIf 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= " " & 個位(位數(7)) & " " & 千位(1)
  572. ElseIf 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= " " & 十位(位數(6)) & " " & 千位(1)
  573. ElseIf 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= " " & 個位(位數(6) & 位數(7)) & " " & 千位(1) : End If
  574. Else
  575. If 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= " " & 十位(位數(6)) & " " & 千位(1)
  576. ElseIf 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= " " & 十位(位數(6)) & " " & 個位(位數(7)) & " " & 千位(1) : End If
  577. End If
  578. '------------------百------------------------------------------------------------------------------------------------------
  579. If CInt(位數(8) & 位數(9) & 末位數) < 100 Then
  580. ElseIf CInt(位數(8) & 位數(9) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  581. ElseIf CInt(位數(8) & 位數(9) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(8)) & " " & 百位(1) : End If
  582. '------------------個十------------------------------------------------------------------------------------------------------
  583. If 位數(9) = "0" And 末位數 = "0" Then
  584. ElseIf 位數(9) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  585. Else
  586. If CInt(位數(9) & 末位數) < 21 Then
  587. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(9)) : Else : 答案 &= " " & 個位(位數(9) & 末位數) : End If
  588. Else
  589. If 位數(9) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(9))
  590. ElseIf 位數(9) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(9)) & " " & 個位(末位數) : End If
  591. End If
  592. End If
  593. ElseIf 數長 = 11 Then
  594. '------------------十十億(百億)------------------------------------------------------------------------------------------------------
  595. If CInt(位數(1) & 位數(2)) < 21 Then
  596. If 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 十億 : Else : 答案 = 個位(位數(1) & 位數(2)) & " " & 十億 : End If
  597. Else
  598. If 位數(1) <> "0" And 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 十億
  599. ElseIf 位數(1) <> "0" And 位數(2) <> "0" Then : 答案 = 十位(位數(1)) & " " & 個位(位數(2)) & " " & 十億 : End If
  600. End If
  601. '------------------百百萬(億)------------------------------------------------------------------------------------------------------
  602. If CInt(位數(3)) = 0 Then
  603. ElseIf CInt(位數(3)) = 1 Then : 答案 &= " " & 百位(0)
  604. ElseIf CInt(位數(3)) > 1 Then : 答案 &= " " & 個位(位數(3)) & " " & 百位(1) : End If
  605. '------------------十百萬(千萬)------------------------------------------------------------------------------------------------------
  606. If 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" Then
  607. ElseIf 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= " " & 百萬
  608. ElseIf 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= " " & 個位(位數(5)) & " " & 百萬
  609. ElseIf CInt(位數(4) & 位數(5)) < 21 Then
  610. If 位數(5) = "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 百萬 : Else : 答案 &= " " & 個位(位數(4) & 位數(5)) & " " & 百萬 : End If
  611. ElseIf CInt(位數(4) & 位數(5)) >= 21 Then
  612. If 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 百萬
  613. ElseIf 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 個位(位數(5)) & " " & 百萬 : End If
  614. End If
  615. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  616. If CInt(位數(6)) = 0 Then : ElseIf CInt(位數(6)) = 1 Then : 答案 &= " " & 百位(0)
  617. ElseIf CInt(位數(6)) > 1 Then : 答案 &= " " & 個位(位數(6)) & " " & 百位(1) : End If
  618. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  619. If CInt(位數(7) & 位數(8)) < 21 Then
  620. If 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" Then
  621. ElseIf 位數(7) = "0" And 位數(8) = "0" Then : 答案 &= " " & 千位(1)
  622. ElseIf 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= " " & 個位(位數(8)) & " " & 千位(1)
  623. ElseIf 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= " " & 十位(位數(7)) & " " & 千位(1)
  624. ElseIf 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= " " & 個位(位數(7) & 位數(8)) & " " & 千位(1) : End If
  625. Else
  626. If 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= " " & 十位(位數(7)) & " " & 千位(1)
  627. ElseIf 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= " " & 十位(位數(7)) & " " & 個位(位數(8)) & " " & 千位(1) : End If
  628. End If
  629. '------------------百------------------------------------------------------------------------------------------------------
  630. If CInt(位數(9) & 位數(10) & 末位數) < 100 Then
  631. ElseIf CInt(位數(9) & 位數(10) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  632. ElseIf CInt(位數(9) & 位數(10) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(9)) & " " & 百位(1) : End If
  633. '------------------個十------------------------------------------------------------------------------------------------------
  634. If 位數(10) = "0" And 末位數 = "0" Then
  635. ElseIf 位數(10) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  636. Else
  637. If CInt(位數(10) & 末位數) < 21 Then
  638. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(10)) : Else : 答案 &= " " & 個位(位數(10) & 末位數) : End If
  639. Else
  640. If 位數(10) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(10))
  641. ElseIf 位數(10) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(10)) & " " & 個位(末位數) : End If
  642. End If
  643. End If
  644. ElseIf 數長 = 12 Then
  645. '------------------百(千億)------------------------------------------------------------------------------------------------------
  646. If 位數(1) = "1" Then : 答案 = 百位(0) : ElseIf 位數(1) <> "1" Then : 答案 = 個位(位數(1)) & " " & 百位(1) : End If
  647. '------------------十十億(百億)------------------------------------------------------------------------------------------------------
  648. If 位數(2) = "0" And 位數(3) = "0" Then : 答案 &= " " & 十億
  649. ElseIf CInt(位數(2) & 位數(3)) < 21 Then
  650. If 位數(3) = "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 十億 : Else : 答案 &= " " & 個位(位數(2) & 位數(3)) & " " & 十億 : End If
  651. Else
  652. If 位數(2) <> "0" And 位數(3) = "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 十億
  653. ElseIf 位數(2) <> "0" And 位數(3) <> "0" Then : 答案 &= " " & 十位(位數(2)) & " " & 個位(位數(3)) & " " & 十億 : End If
  654. End If
  655. '------------------百百萬(億)------------------------------------------------------------------------------------------------------
  656. If CInt(位數(4)) = 0 Then
  657. ElseIf CInt(位數(4)) = 1 Then : 答案 &= " " & 百位(0)
  658. ElseIf CInt(位數(4)) > 1 Then : 答案 &= " " & 個位(位數(4)) & " " & 百位(1) : End If
  659. '------------------十百萬(千萬)------------------------------------------------------------------------------------------------------
  660. If 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" Then
  661. ElseIf 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= " " & 百萬
  662. ElseIf 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= " " & 個位(位數(6)) & " " & 百萬
  663. ElseIf CInt(位數(5) & 位數(6)) < 21 Then
  664. If 位數(6) = "0" Then : 答案 &= " " & 十位(位數(5)) & " " & 百萬 : Else : 答案 &= " " & 個位(位數(5) & 位數(6)) & " " & 百萬 : End If
  665. ElseIf CInt(位數(5) & 位數(6)) >= 21 Then
  666. If 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= " " & 十位(位數(5)) & " " & 百萬
  667. ElseIf 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= " " & 十位(位數(5)) & " " & 個位(位數(6)) & " " & 百萬 : End If
  668. End If
  669. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  670. If CInt(位數(7)) = 0 Then : ElseIf CInt(位數(7)) = 1 Then : 答案 &= " " & 百位(0)
  671. ElseIf CInt(位數(7)) > 1 Then : 答案 &= " " & 個位(位數(7)) & " " & 百位(1) : End If
  672. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  673. If CInt(位數(8) & 位數(9)) < 21 Then
  674. If 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" Then
  675. ElseIf 位數(8) = "0" And 位數(9) = "0" Then : 答案 &= " " & 千位(1)
  676. ElseIf 位數(8) = "0" And 位數(9) <> "0" Then : 答案 &= " " & 個位(位數(9)) & " " & 千位(1)
  677. ElseIf 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= " " & 十位(位數(8)) & " " & 千位(1)
  678. ElseIf 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= " " & 個位(位數(8) & 位數(9)) & " " & 千位(1) : End If
  679. Else
  680. If 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= " " & 十位(位數(8)) & " " & 千位(1)
  681. ElseIf 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= " " & 十位(位數(8)) & " " & 個位(位數(9)) & " " & 千位(1) : End If
  682. End If
  683. '------------------百------------------------------------------------------------------------------------------------------
  684. If CInt(位數(10) & 位數(11) & 末位數) < 100 Then
  685. ElseIf CInt(位數(10) & 位數(11) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  686. ElseIf CInt(位數(10) & 位數(11) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(10)) & " " & 百位(1) : End If
  687. '------------------個十------------------------------------------------------------------------------------------------------
  688. If 位數(11) = "0" And 末位數 = "0" Then
  689. ElseIf 位數(11) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  690. Else
  691. If CInt(位數(11) & 末位數) < 21 Then
  692. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(11)) : Else : 答案 &= " " & 個位(位數(11) & 末位數) : End If
  693. Else
  694. If 位數(11) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(11))
  695. ElseIf 位數(11) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(11)) & " " & 個位(末位數) : End If
  696. End If
  697. End If
  698. ElseIf 數長 = 13 Then
  699. '------------------兆------------------------------------------------------------------------------------------------------
  700. 答案 = 個位(位數(1)) & " " & 兆
  701. '------------------百(千億)------------------------------------------------------------------------------------------------------
  702. If 位數(2) = "0" Then
  703. ElseIf 位數(2) = "1" Then : 答案 &= " " & 百位(0)
  704. ElseIf 位數(2) <> "1" Then : 答案 &= " " & 個位(位數(2)) & " " & 百位(1) : End If
  705. '------------------十十億(百億)------------------------------------------------------------------------------------------------------
  706. If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" Then
  707. ElseIf 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= " " & 十億
  708. ElseIf CInt(位數(3) & 位數(4)) < 21 Then
  709. If 位數(4) = "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 十億 : Else : 答案 &= " " & 個位(位數(3) & 位數(4)) & " " & 十億 : End If
  710. Else
  711. If 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 十億
  712. ElseIf 位數(3) <> "0" And 位數(4) <> "0" Then : 答案 &= " " & 十位(位數(3)) & " " & 個位(位數(4)) & " " & 十億 : End If
  713. End If
  714. '------------------百百萬(億)------------------------------------------------------------------------------------------------------
  715. If CInt(位數(5)) = 0 Then
  716. ElseIf CInt(位數(5)) = 1 Then : 答案 &= " " & 百位(0)
  717. ElseIf CInt(位數(5)) > 1 Then : 答案 &= " " & 個位(位數(5)) & " " & 百位(1) : End If
  718. '------------------十百萬(千萬)------------------------------------------------------------------------------------------------------
  719. If 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" Then
  720. ElseIf 位數(6) = "0" And 位數(7) = "0" Then : 答案 &= " " & 百萬
  721. ElseIf 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= " " & 個位(位數(7)) & " " & 百萬
  722. ElseIf CInt(位數(6) & 位數(7)) < 21 Then
  723. If 位數(7) = "0" Then : 答案 &= " " & 十位(位數(6)) & " " & 百萬 : Else : 答案 &= " " & 個位(位數(6) & 位數(7)) & " " & 百萬 : End If
  724. ElseIf CInt(位數(6) & 位數(7)) >= 21 Then
  725. If 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= " " & 十位(位數(6)) & " " & 百萬
  726. ElseIf 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= " " & 十位(位數(6)) & " " & 個位(位數(7)) & " " & 百萬 : End If
  727. End If
  728. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  729. If CInt(位數(8)) = 0 Then : ElseIf CInt(位數(8)) = 1 Then : 答案 &= " " & 百位(0)
  730. ElseIf CInt(位數(8)) > 1 Then : 答案 &= " " & 個位(位數(8)) & " " & 百位(1) : End If
  731. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  732. If CInt(位數(9) & 位數(10)) < 21 Then
  733. If 位數(8) = "0" And 位數(9) = "0" And 位數(10) = "0" Then
  734. ElseIf 位數(9) = "0" And 位數(10) = "0" Then : 答案 &= " " & 千位(1)
  735. ElseIf 位數(9) = "0" And 位數(10) <> "0" Then : 答案 &= " " & 個位(位數(10)) & " " & 千位(1)
  736. ElseIf 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= " " & 十位(位數(9)) & " " & 千位(1)
  737. ElseIf 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= " " & 個位(位數(9) & 位數(10)) & " " & 千位(1) : End If
  738. Else
  739. If 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= " " & 十位(位數(9)) & " " & 千位(1)
  740. ElseIf 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= " " & 十位(位數(9)) & " " & 個位(位數(10)) & " " & 千位(1) : End If
  741. End If
  742. '------------------百------------------------------------------------------------------------------------------------------
  743. If CInt(位數(11) & 位數(12) & 末位數) < 100 Then
  744. ElseIf CInt(位數(11) & 位數(12) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  745. ElseIf CInt(位數(11) & 位數(12) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(11)) & " " & 百位(1) : End If
  746. '------------------個十------------------------------------------------------------------------------------------------------
  747. If 位數(12) = "0" And 末位數 = "0" Then
  748. ElseIf 位數(12) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  749. Else
  750. If CInt(位數(12) & 末位數) < 21 Then
  751. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(12)) : Else : 答案 &= " " & 個位(位數(12) & 末位數) : End If
  752. Else
  753. If 位數(12) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(12))
  754. ElseIf 位數(12) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(12)) & " " & 個位(末位數) : End If
  755. End If
  756. End If
  757. ElseIf 數長 = 14 Then
  758. '------------------十兆------------------------------------------------------------------------------------------------------
  759. If CInt(位數(1) & 位數(2)) < 21 Then
  760. If 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 兆 : Else : 答案 = 個位(位數(1) & 位數(2)) & " " & 兆 : End If
  761. Else
  762. If 位數(1) <> "0" And 位數(2) = "0" Then : 答案 = 十位(位數(1)) & " " & 兆
  763. ElseIf 位數(1) <> "0" And 位數(2) <> "0" Then : 答案 = 十位(位數(1)) & " " & 個位(位數(2)) & " " & 兆 : End If
  764. End If
  765. '------------------百(千億)------------------------------------------------------------------------------------------------------
  766. If 位數(3) = "0" Then
  767. ElseIf 位數(3) = "1" Then : 答案 &= " " & 百位(0)
  768. ElseIf 位數(3) <> "1" Then : 答案 &= " " & 個位(位數(3)) & " " & 百位(1) : End If
  769. '------------------十十億(百億)------------------------------------------------------------------------------------------------------
  770. If 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" Then
  771. ElseIf 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= " " & 十億
  772. ElseIf CInt(位數(4) & 位數(5)) < 21 Then
  773. If 位數(5) = "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 十億 : Else : 答案 &= " " & 個位(位數(4) & 位數(5)) & " " & 十億 : End If
  774. Else
  775. If 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 十億
  776. ElseIf 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= " " & 十位(位數(4)) & " " & 個位(位數(5)) & " " & 十億 : End If
  777. End If
  778. '------------------百百萬(億)------------------------------------------------------------------------------------------------------
  779. If CInt(位數(6)) = 0 Then
  780. ElseIf CInt(位數(6)) = 1 Then : 答案 &= " " & 百位(0)
  781. ElseIf CInt(位數(6)) > 1 Then : 答案 &= " " & 個位(位數(6)) & " " & 百位(1) : End If
  782. '------------------十百萬(千萬)------------------------------------------------------------------------------------------------------
  783. If 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" Then
  784. ElseIf 位數(7) = "0" And 位數(8) = "0" Then : 答案 &= " " & 百萬
  785. ElseIf 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= " " & 個位(位數(8)) & " " & 百萬
  786. ElseIf CInt(位數(7) & 位數(8)) < 21 Then
  787. If 位數(8) = "0" Then : 答案 &= " " & 十位(位數(7)) & " " & 百萬 : Else : 答案 &= " " & 個位(位數(7) & 位數(8)) & " " & 百萬 : End If
  788. ElseIf CInt(位數(7) & 位數(8)) >= 21 Then
  789. If 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= " " & 十位(位數(7)) & " " & 百萬
  790. ElseIf 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= " " & 十位(位數(7)) & " " & 個位(位數(8)) & " " & 百萬 : End If
  791. End If
  792. '------------------百千(十萬)------------------------------------------------------------------------------------------------------
  793. If CInt(位數(9)) = 0 Then : ElseIf CInt(位數(9)) = 1 Then : 答案 &= " " & 百位(0)
  794. ElseIf CInt(位數(9)) > 1 Then : 答案 &= " " & 個位(位數(9)) & " " & 百位(1) : End If
  795. '------------------十千(萬)------------------------------------------------------------------------------------------------------
  796. If CInt(位數(10) & 位數(11)) < 21 Then
  797. If 位數(9) = "0" And 位數(10) = "0" And 位數(11) = "0" Then
  798. ElseIf 位數(10) = "0" And 位數(11) = "0" Then : 答案 &= " " & 千位(1)
  799. ElseIf 位數(10) = "0" And 位數(11) <> "0" Then : 答案 &= " " & 個位(位數(11)) & " " & 千位(1)
  800. ElseIf 位數(10) <> "0" And 位數(11) = "0" Then : 答案 &= " " & 十位(位數(10)) & " " & 千位(1)
  801. ElseIf 位數(10) <> "0" And 位數(11) <> "0" Then : 答案 &= " " & 個位(位數(10) & 位數(11)) & " " & 千位(1) : End If
  802. Else
  803. If 位數(10) <> "0" And 位數(11) = "0" Then : 答案 &= " " & 十位(位數(10)) & " " & 千位(1)
  804. ElseIf 位數(10) <> "0" And 位數(11) <> "0" Then : 答案 &= " " & 十位(位數(10)) & " " & 個位(位數(11)) & " " & 千位(1) : End If
  805. End If
  806. '------------------百------------------------------------------------------------------------------------------------------
  807. If CInt(位數(12) & 位數(13) & 末位數) < 100 Then
  808. ElseIf CInt(位數(12) & 位數(13) & 末位數) < 200 Then : 答案 &= " " & 百位(0)
  809. ElseIf CInt(位數(12) & 位數(13) & 末位數) >= 200 Then : 答案 &= " " & 個位(位數(12)) & " " & 百位(1) : End If
  810. '------------------個十------------------------------------------------------------------------------------------------------
  811. If 位數(13) = "0" And 末位數 = "0" Then
  812. ElseIf 位數(13) = "0" And 末位數 <> "0" Then : 答案 &= " " & 個位(末位數)
  813. Else
  814. If CInt(位數(13) & 末位數) < 21 Then
  815. If 末位數 = "0" Then : 答案 &= " " & 十位(位數(13)) : Else : 答案 &= " " & 個位(位數(13) & 末位數) : End If
  816. Else
  817. If 位數(13) <> "0" And 末位數 = "0" Then : 答案 &= " " & 十位(位數(13))
  818. ElseIf 位數(13) <> "0" And 末位數 <> "0" Then : 答案 &= " " & 十位(位數(13)) & " " & 個位(末位數)
  819. End If
  820. End If
  821. End If
  822. End If
  823. Else
  824. If 數長 = 1 Then : 答案 = 個位(申請金額_nud.Value)
  825. ElseIf 數長 = 2 Then
  826. If 末位數 = "0" Then : 答案 = 個位(位數(1)) & 拾 : Else : 答案 = 個位(位數(1)) & 拾 & 個位(末位數) : End If
  827. ElseIf 數長 = 3 Then : 答案 = 個位(位數(1)) & 百
  828. If 位數(2) = "0" And 末位數 = "0" Then
  829. ElseIf 位數(2) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  830. ElseIf 位數(2) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 拾
  831. ElseIf 位數(2) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 拾 & 個位(末位數)
  832. End If
  833. ElseIf 數長 = 4 Then : 答案 = 個位(位數(1)) & 仟
  834. If 位數(2) = "0" And 位數(3) = "0" And 末位數 = "0" Then
  835. ElseIf 位數(2) = "0" And 位數(3) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  836. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾 & 個位(末位數)
  837. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾
  838. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 百
  839. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 零 & 個位(末位數)
  840. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾
  841. ElseIf 位數(2) <> "0" And 末位數 <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾 & 個位(末位數)
  842. End If
  843. ElseIf 數長 = 5 Then : 答案 = 個位(位數(1)) & 萬
  844. If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" And 末位數 = "0" Then
  845. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  846. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾
  847. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾 & 個位(末位數)
  848. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(3)) & 百
  849. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 零 & 個位(末位數)
  850. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾
  851. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 個位(末位數)
  852. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 仟
  853. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(末位數)
  854. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(位數(4)) & 拾
  855. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(位數(4)) & 拾 & 個位(末位數)
  856. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百
  857. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 零 & 個位(末位數)
  858. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾
  859. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 個位(末位數)
  860. End If
  861. ElseIf 數長 = 6 Then
  862. If 位數(2) = "0" Then : 答案 = 個位(位數(1)) & 拾 & 萬 : Else : 答案 = 個位(位數(1)) & 拾 & 個位(位數(2)) & 萬 : End If
  863. If 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" And 末位數 = "0" Then
  864. ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  865. ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾
  866. ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾 & 個位(末位數)
  867. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(4)) & 百
  868. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 零 & 個位(末位數)
  869. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾
  870. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 個位(末位數)
  871. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(3)) & 仟
  872. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(末位數)
  873. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(位數(5)) & 拾
  874. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(位數(5)) & 拾 & 個位(末位數)
  875. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百
  876. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 零 & 個位(末位數)
  877. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾
  878. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 個位(末位數)
  879. End If
  880. ElseIf 數長 = 7 Then : 答案 = 個位(位數(1)) & 百
  881. If 位數(2) = "0" And 位數(3) = "0" Then : 答案 &= 萬
  882. ElseIf 位數(2) = "0" And 位數(3) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 萬
  883. ElseIf 位數(2) <> "0" And 位數(3) = "0" Then : 答案 &= 個位(位數(2)) & 拾 & 萬
  884. ElseIf 位數(2) <> "0" And 位數(3) <> "0" Then : 答案 &= 個位(位數(2)) & 拾 & 個位(位數(3)) & 萬
  885. End If
  886. If 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" And 末位數 = "0" Then
  887. ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  888. ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(6)) & 拾
  889. ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 拾 & 個位(末位數)
  890. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(5)) & 百
  891. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 零 & 個位(末位數)
  892. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾
  893. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 個位(末位數)
  894. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(4)) & 仟
  895. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(末位數)
  896. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(位數(6)) & 拾
  897. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(位數(6)) & 拾 & 個位(末位數)
  898. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百
  899. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 零 & 個位(末位數)
  900. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾
  901. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 個位(末位數)
  902. End If
  903. ElseIf 數長 = 8 Then : 答案 = 個位(位數(1)) & 仟
  904. If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= 萬
  905. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 萬
  906. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾 & 個位(位數(4)) & 萬
  907. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾 & 萬
  908. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= 個位(位數(2)) & 百 & 萬
  909. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 零 & 個位(位數(4)) & 萬
  910. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾 & 萬
  911. ElseIf 位數(2) <> "0" And 位數(4) <> "0" And 位數(4) <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾 & 個位(位數(4)) & 萬
  912. End If
  913. If 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" And 末位數 = "0" Then
  914. ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  915. ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(7)) & 拾
  916. ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 拾 & 個位(末位數)
  917. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(6)) & 百
  918. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 零 & 個位(末位數)
  919. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾
  920. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 個位(末位數)
  921. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(5)) & 仟
  922. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(末位數)
  923. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(位數(7)) & 拾
  924. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(位數(7)) & 拾 & 個位(末位數)
  925. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百
  926. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 零 & 個位(末位數)
  927. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾
  928. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 個位(末位數)
  929. End If
  930. ElseIf 數長 = 9 Then : 答案 = 個位(位數(1)) & 億
  931. If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" Then
  932. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 萬
  933. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾 & 萬
  934. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 萬
  935. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 萬
  936. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 零 & 個位(位數(5)) & 萬
  937. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 萬
  938. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 萬
  939. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 萬
  940. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(位數(5)) & 萬
  941. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(位數(4)) & 拾 & 萬
  942. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 萬
  943. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 萬
  944. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 零 & 個位(位數(5)) & 萬
  945. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 萬
  946. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 萬
  947. End If
  948. If 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" And 末位數 = "0" Then
  949. ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  950. ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(8)) & 拾
  951. ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 拾 & 個位(末位數)
  952. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(7)) & 百
  953. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 零 & 個位(末位數)
  954. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾
  955. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 個位(末位數)
  956. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(6)) & 仟
  957. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(末位數)
  958. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(位數(8)) & 拾
  959. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(位數(8)) & 拾 & 個位(末位數)
  960. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百
  961. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 零 & 個位(末位數)
  962. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾
  963. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 個位(末位數)
  964. End If
  965. ElseIf 數長 = 10 Then
  966. If 位數(2) = "0" Then : 答案 = 個位(位數(1)) & 拾 & 億 : Else : 答案 = 個位(位數(1)) & 拾 & 個位(位數(2)) & 億 : End If
  967. If 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" Then
  968. ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 萬
  969. ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾 & 萬
  970. ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 萬
  971. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 萬
  972. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 零 & 個位(位數(6)) & 萬
  973. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 萬
  974. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 萬
  975. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 萬
  976. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(位數(6)) & 萬
  977. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(位數(5)) & 拾 & 萬
  978. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 萬
  979. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 萬
  980. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 零 & 個位(位數(6)) & 萬
  981. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 萬
  982. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 萬
  983. End If
  984. If 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" And 末位數 = "0" Then
  985. ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  986. ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(9)) & 拾
  987. ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(9)) & 拾 & 個位(末位數)
  988. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(8)) & 百
  989. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 零 & 個位(末位數)
  990. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾
  991. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 個位(末位數)
  992. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(7)) & 仟
  993. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(末位數)
  994. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(位數(9)) & 拾
  995. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(位數(9)) & 拾 & 個位(末位數)
  996. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百
  997. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 零 & 個位(末位數)
  998. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾
  999. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 個位(末位數)
  1000. End If
  1001. ElseIf 數長 = 11 Then : 答案 = 個位(位數(1)) & 百
  1002. If 位數(2) = "0" And 位數(3) = "0" Then : 答案 &= 億
  1003. ElseIf 位數(2) = "0" And 位數(3) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 億
  1004. ElseIf 位數(2) <> "0" And 位數(3) = "0" Then : 答案 &= 個位(位數(2)) & 拾 & 億
  1005. ElseIf 位數(2) <> "0" And 位數(3) <> "0" Then : 答案 &= 個位(位數(2)) & 拾 & 個位(位數(3)) & 億
  1006. End If
  1007. If 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" Then
  1008. ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 萬
  1009. ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= 零 & 個位(位數(6)) & 拾 & 萬
  1010. ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 拾 & 個位(位數(7)) & 萬
  1011. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 萬
  1012. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 零 & 個位(位數(7)) & 萬
  1013. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 萬
  1014. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 個位(位數(7)) & 萬
  1015. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 萬
  1016. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(位數(7)) & 萬
  1017. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(位數(6)) & 拾 & 萬
  1018. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(位數(6)) & 拾 & 個位(位數(7)) & 萬
  1019. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 萬
  1020. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 零 & 個位(位數(7)) & 萬
  1021. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 萬
  1022. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 個位(位數(7)) & 萬
  1023. End If
  1024. If 位數(8) = "0" And 位數(9) = "0" And 位數(10) = "0" And 末位數 = "0" Then
  1025. ElseIf 位數(8) = "0" And 位數(9) = "0" And 位數(10) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  1026. ElseIf 位數(8) = "0" And 位數(9) = "0" And 位數(10) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(10)) & 拾
  1027. ElseIf 位數(8) = "0" And 位數(9) = "0" And 位數(10) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(10)) & 拾 & 個位(末位數)
  1028. ElseIf 位數(8) = "0" And 位數(9) <> "0" And 位數(10) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(9)) & 百
  1029. ElseIf 位數(8) = "0" And 位數(9) <> "0" And 位數(10) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(9)) & 百 & 零 & 個位(末位數)
  1030. ElseIf 位數(8) = "0" And 位數(9) <> "0" And 位數(10) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(9)) & 百 & 個位(位數(10)) & 拾
  1031. ElseIf 位數(8) = "0" And 位數(9) <> "0" And 位數(10) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(9)) & 百 & 個位(位數(10)) & 拾 & 個位(末位數)
  1032. ElseIf 位數(8) <> "0" And 位數(9) = "0" And 位數(10) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(8)) & 仟
  1033. ElseIf 位數(8) <> "0" And 位數(9) = "0" And 位數(10) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(8)) & 仟 & 零 & 個位(末位數)
  1034. ElseIf 位數(8) <> "0" And 位數(9) = "0" And 位數(10) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(8)) & 仟 & 零 & 個位(位數(10)) & 拾
  1035. ElseIf 位數(8) <> "0" And 位數(9) = "0" And 位數(10) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(8)) & 仟 & 零 & 個位(位數(10)) & 拾 & 個位(末位數)
  1036. ElseIf 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(8)) & 仟 & 個位(位數(9)) & 百
  1037. ElseIf 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(8)) & 仟 & 個位(位數(9)) & 百 & 零 & 個位(末位數)
  1038. ElseIf 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(8)) & 仟 & 個位(位數(9)) & 百 & 個位(位數(10)) & 拾
  1039. ElseIf 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(8)) & 仟 & 個位(位數(9)) & 百 & 個位(位數(10)) & 拾 & 個位(末位數)
  1040. End If
  1041. ElseIf 數長 = 12 Then : 答案 = 個位(位數(1)) & 仟
  1042. If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= 億
  1043. ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 億
  1044. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾 & 個位(位數(4)) & 億
  1045. ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾 & 億
  1046. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= 個位(位數(2)) & 百 & 億
  1047. ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 零 & 個位(位數(4)) & 億
  1048. ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾 & 億
  1049. ElseIf 位數(2) <> "0" And 位數(4) <> "0" And 位數(4) <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾 & 個位(位數(4)) & 億
  1050. End If
  1051. If 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" Then
  1052. ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 萬
  1053. ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= 零 & 個位(位數(7)) & 拾 & 萬
  1054. ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 拾 & 個位(位數(8)) & 萬
  1055. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 萬
  1056. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 零 & 個位(位數(8)) & 萬
  1057. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 萬
  1058. ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 個位(位數(8)) & 萬
  1059. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 萬
  1060. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(位數(8)) & 萬
  1061. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(位數(7)) & 拾 & 萬
  1062. ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(位數(7)) & 拾 & 個位(位數(8)) & 萬
  1063. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 萬
  1064. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 零 & 個位(位數(8)) & 萬
  1065. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 萬
  1066. ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 個位(位數(8)) & 萬
  1067. End If
  1068. If 位數(9) = "0" And 位數(10) = "0" And 位數(11) = "0" And 末位數 = "0" Then
  1069. ElseIf 位數(9) = "0" And 位數(10) = "0" And 位數(11) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  1070. ElseIf 位數(9) = "0" And 位數(10) = "0" And 位數(11) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(11)) & 拾
  1071. ElseIf 位數(9) = "0" And 位數(10) = "0" And 位數(11) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(11)) & 拾 & 個位(末位數)
  1072. ElseIf 位數(9) = "0" And 位數(10) <> "0" And 位數(11) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(10)) & 百
  1073. ElseIf 位數(9) = "0" And 位數(10) <> "0" And 位數(11) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(10)) & 百 & 零 & 個位(末位數)
  1074. ElseIf 位數(9) = "0" And 位數(10) <> "0" And 位數(11) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(10)) & 百 & 個位(位數(11)) & 拾
  1075. ElseIf 位數(9) = "0" And 位數(10) <> "0" And 位數(11) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(10)) & 百 & 個位(位數(11)) & 拾 & 個位(末位數)
  1076. ElseIf 位數(9) <> "0" And 位數(10) = "0" And 位數(11) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(9)) & 仟
  1077. ElseIf 位數(9) <> "0" And 位數(10) = "0" And 位數(11) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(9)) & 仟 & 零 & 個位(末位數)
  1078. ElseIf 位數(9) <> "0" And 位數(10) = "0" And 位數(11) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(9)) & 仟 & 零 & 個位(位數(11)) & 拾
  1079. ElseIf 位數(9) <> "0" And 位數(10) = "0" And 位數(11) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(9)) & 仟 & 零 & 個位(位數(11)) & 拾 & 個位(末位數)
  1080. ElseIf 位數(9) <> "0" And 位數(10) <> "0" And 位數(11) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(9)) & 仟 & 個位(位數(10)) & 百
  1081. ElseIf 位數(9) <> "0" And 位數(10) <> "0" And 位數(11) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(9)) & 仟 & 個位(位數(10)) & 百 & 零 & 個位(末位數)
  1082. ElseIf 位數(9) <> "0" And 位數(10) <> "0" And 位數(11) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(9)) & 仟 & 個位(位數(10)) & 百 & 個位(位數(11)) & 拾
  1083. ElseIf 位數(9) <> "0" And 位數(10) <> "0" And 位數(11) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(9)) & 仟 & 個位(位數(10)) & 百 & 個位(位數(11)) & 拾 & 個位(末位數)
  1084. End If
  1085. ElseIf 數長 = 13 Then : 答案 = 個位(位數(1)) & 兆 : 答案 &= 個位(位數(2)) & 仟
  1086. If 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= 億
  1087. ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 億
  1088. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 億
  1089. ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾 & 億
  1090. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(3)) & 百 & 億
  1091. ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(3)) & 百 & 零 & 個位(位數(5)) & 億
  1092. ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 億
  1093. ElseIf 位數(3) <> "0" And 位數(5) <> "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 億
  1094. End If
  1095. If 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" Then
  1096. ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" Then : 答案 &= 零 & 個位(位數(9)) & 萬
  1097. ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= 零 & 個位(位數(8)) & 拾 & 萬
  1098. ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 拾 & 個位(位數(9)) & 萬
  1099. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 萬
  1100. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 零 & 個位(位數(9)) & 萬
  1101. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 萬
  1102. ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 個位(位數(9)) & 萬
  1103. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 萬
  1104. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(位數(9)) & 萬
  1105. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(位數(8)) & 拾 & 萬
  1106. ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(位數(8)) & 拾 & 個位(位數(9)) & 萬
  1107. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 萬
  1108. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 零 & 個位(位數(9)) & 萬
  1109. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 萬
  1110. ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 個位(位數(9)) & 萬
  1111. End If
  1112. If 位數(10) = "0" And 位數(11) = "0" And 位數(12) = "0" And 末位數 = "0" Then
  1113. ElseIf 位數(10) = "0" And 位數(11) = "0" And 位數(12) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  1114. ElseIf 位數(10) = "0" And 位數(11) = "0" And 位數(12) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(12)) & 拾
  1115. ElseIf 位數(10) = "0" And 位數(11) = "0" And 位數(12) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(12)) & 拾 & 個位(末位數)
  1116. ElseIf 位數(10) = "0" And 位數(11) <> "0" And 位數(12) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(11)) & 百
  1117. ElseIf 位數(10) = "0" And 位數(11) <> "0" And 位數(12) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(11)) & 百 & 零 & 個位(末位數)
  1118. ElseIf 位數(10) = "0" And 位數(11) <> "0" And 位數(12) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(11)) & 百 & 個位(位數(12)) & 拾
  1119. ElseIf 位數(10) = "0" And 位數(11) <> "0" And 位數(12) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(11)) & 百 & 個位(位數(12)) & 拾 & 個位(末位數)
  1120. ElseIf 位數(10) <> "0" And 位數(11) = "0" And 位數(12) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(10)) & 仟
  1121. ElseIf 位數(10) <> "0" And 位數(11) = "0" And 位數(12) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(10)) & 仟 & 零 & 個位(末位數)
  1122. ElseIf 位數(10) <> "0" And 位數(11) = "0" And 位數(12) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(10)) & 仟 & 零 & 個位(位數(12)) & 拾
  1123. ElseIf 位數(10) <> "0" And 位數(11) = "0" And 位數(12) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(10)) & 仟 & 零 & 個位(位數(12)) & 拾 & 個位(末位數)
  1124. ElseIf 位數(10) <> "0" And 位數(11) <> "0" And 位數(12) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(10)) & 仟 & 個位(位數(11)) & 百
  1125. ElseIf 位數(10) <> "0" And 位數(11) <> "0" And 位數(12) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(10)) & 仟 & 個位(位數(11)) & 百 & 零 & 個位(末位數)
  1126. ElseIf 位數(10) <> "0" And 位數(11) <> "0" And 位數(12) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(10)) & 仟 & 個位(位數(11)) & 百 & 個位(位數(12)) & 拾
  1127. ElseIf 位數(10) <> "0" And 位數(11) <> "0" And 位數(12) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(10)) & 仟 & 個位(位數(11)) & 百 & 個位(位數(12)) & 拾 & 個位(末位數)
  1128. End If
  1129. ElseIf 數長 = 14 Then
  1130. If 位數(2) = "0" Then : 答案 = 個位(位數(1)) & 拾 & 兆 : Else : 答案 = 個位(位數(1)) & 拾 & 個位(位數(2)) & 兆 : End If : 答案 &= 個位(位數(3)) & 仟
  1131. If 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= 億
  1132. ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 億
  1133. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 億
  1134. ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾 & 億
  1135. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(4)) & 百 & 億
  1136. ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(4)) & 百 & 零 & 個位(位數(6)) & 億
  1137. ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 億
  1138. ElseIf 位數(4) <> "0" And 位數(6) <> "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 億
  1139. End If
  1140. If 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" And 位數(10) = "0" Then
  1141. ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" And 位數(10) <> "0" Then : 答案 &= 零 & 個位(位數(10)) & 萬
  1142. ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= 零 & 個位(位數(9)) & 拾 & 萬
  1143. ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= 零 & 個位(位數(9)) & 拾 & 個位(位數(10)) & 萬
  1144. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" And 位數(10) = "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 萬
  1145. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" And 位數(10) <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 零 & 個位(位數(10)) & 萬
  1146. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 萬
  1147. ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 個位(位數(10)) & 萬
  1148. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" And 位數(10) = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 萬
  1149. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" And 位數(10) <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(位數(10)) & 萬
  1150. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(位數(9)) & 拾 & 萬
  1151. ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(位數(9)) & 拾 & 個位(位數(10)) & 萬
  1152. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" And 位數(10) = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 萬
  1153. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" And 位數(10) <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 零 & 個位(位數(10)) & 萬
  1154. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 萬
  1155. ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 個位(位數(10)) & 萬
  1156. End If
  1157. If 位數(11) = "0" And 位數(12) = "0" And 位數(13) = "0" And 末位數 = "0" Then
  1158. ElseIf 位數(11) = "0" And 位數(12) = "0" And 位數(13) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
  1159. ElseIf 位數(11) = "0" And 位數(12) = "0" And 位數(13) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(13)) & 拾
  1160. ElseIf 位數(11) = "0" And 位數(12) = "0" And 位數(13) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(13)) & 拾 & 個位(末位數)
  1161. ElseIf 位數(11) = "0" And 位數(12) <> "0" And 位數(13) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(12)) & 百
  1162. ElseIf 位數(11) = "0" And 位數(12) <> "0" And 位數(13) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(12)) & 百 & 零 & 個位(末位數)
  1163. ElseIf 位數(11) = "0" And 位數(12) <> "0" And 位數(13) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(12)) & 百 & 個位(位數(13)) & 拾
  1164. ElseIf 位數(11) = "0" And 位數(12) <> "0" And 位數(13) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(12)) & 百 & 個位(位數(13)) & 拾 & 個位(末位數)
  1165. ElseIf 位數(11) <> "0" And 位數(12) = "0" And 位數(13) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(11)) & 仟
  1166. ElseIf 位數(11) <> "0" And 位數(12) = "0" And 位數(13) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(11)) & 仟 & 零 & 個位(末位數)
  1167. ElseIf 位數(11) <> "0" And 位數(12) = "0" And 位數(13) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(11)) & 仟 & 零 & 個位(位數(13)) & 拾
  1168. ElseIf 位數(11) <> "0" And 位數(12) = "0" And 位數(13) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(11)) & 仟 & 零 & 個位(位數(13)) & 拾 & 個位(末位數)
  1169. ElseIf 位數(11) <> "0" And 位數(12) <> "0" And 位數(13) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(11)) & 仟 & 個位(位數(12)) & 百
  1170. ElseIf 位數(11) <> "0" And 位數(12) <> "0" And 位數(13) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(11)) & 仟 & 個位(位數(12)) & 百 & 零 & 個位(末位數)
  1171. ElseIf 位數(11) <> "0" And 位數(12) <> "0" And 位數(13) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(11)) & 仟 & 個位(位數(12)) & 百 & 個位(位數(13)) & 拾
  1172. ElseIf 位數(11) <> "0" And 位數(12) <> "0" And 位數(13) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(11)) & 仟 & 個位(位數(12)) & 百 & 個位(位數(13)) & 拾 & 個位(末位數)
  1173. End If
  1174. End If
  1175. End If
  1176. If 系統語言 = "繁體中文" Then : 金額大寫_tb.Text = 答案 & " 元整"
  1177. ElseIf 系統語言 = "Indonesian" Then : 金額大寫_tb.Text = 答案 & " Rupiah"
  1178. ElseIf 系統語言 = "English" Then : 金額大寫_tb.Text = 答案 & " Rupee" : End If
  1179. End Sub
  1180. Private Sub 列印成EXCEL_bt_Click(sender As Object, e As EventArgs) Handles 列印成EXCEL_bt.Click
  1181. If 系統單號_bt.Text = "" Then : MGB(對話框(3), 1) : 首次開啟 = False : Else
  1182. xlApp = CType(CreateObject("Excel.Application"), Application)
  1183. xlBook = xlApp.Workbooks.Add
  1184. xlApp.DisplayAlerts = True
  1185. xlApp.Visible = True
  1186. xlApp.Application.WindowState = xlMaximized
  1187. xlSheet = NewMethod(xlBook) : xlApp.Sheets(1).Select
  1188. xlApp.Sheets(1).Name = 單號_tb.Text.Replace("/", "_") : xlBook.Activate() : xlSheet.Activate()
  1189. xlSheet.Cells(2, 1) = Label7.Text
  1190. xlSheet.Cells(3, 1) = 單號_tb.Text
  1191. xlSheet.Cells(5, 2) = Label2.Text : xlSheet.Cells(5, 3) = "' : " : xlSheet.Cells(5, 4) = "'" & Strings.Format(申請日期_dtp.Value, "yyyy/MM/dd")
  1192. xlSheet.Cells(6, 2) = Label1.Text : xlSheet.Cells(6, 3) = "' : " : xlSheet.Cells(6, 4) = 部門選單_cb.Text
  1193. xlSheet.Cells(7, 2) = Label3.Text : xlSheet.Cells(7, 3) = "' : " : xlSheet.Cells(7, 4) = Strings.Format(申請金額_nud.Value, "#,##0")
  1194. xlSheet.Cells(8, 2) = Label4.Text : xlSheet.Cells(8, 3) = "' : " : xlSheet.Cells(8, 4) = 金額大寫_tb.Text
  1195. xlSheet.Cells(9, 2) = Label5.Text : xlSheet.Cells(9, 3) = "' : " : xlSheet.Cells(9, 4) = 內容_tb.Text
  1196. xlSheet.Cells(10, 2) = Label6.Text : xlSheet.Cells(10, 3) = "' : "
  1197. xlSheet.Cells(10, 4) = Label18.Text & " : " & 支付對象_tb.Text & vbCrLf & Label15.Text & " : " & 營行帳號_tb.Text & vbCrLf &
  1198. Label17.Text & " : " & 支付銀行_tb.Text & vbCrLf & Label16.Text & " : " & 銀行支行_tb.Text
  1199. xlSheet.Cells(12, 4) = Label8.Text : xlSheet.Cells(13, 4) = 申請人_tb.Text
  1200. xlSheet.Cells(12, 6) = Label9.Text : xlSheet.Cells(14, 6) = Label11.Text
  1201. xlSheet.Cells(12, 8) = Label10.Text : xlSheet.Cells(14, 8) = Label12.Text
  1202. AA(xlApp, xlSheet)
  1203. If 選擇公司_cb.Text = "PT HONG XHE INDUSTRIAL" Then : CC(xlApp, xlSheet) : Else : DD(xlApp, xlSheet) : End If
  1204. xlApp.Sheets(2).Delete : xlSheet.PageSetup.PrintArea = ""
  1205. '-------------轉換成PDF---------------------------------------------------------------------
  1206. Dim SERT As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
  1207. xlBook.Sheets(1).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, SERT & "\" & 單號_tb.Text.Replace("/", "_") & ".pdf", XlFixedFormatQuality.xlQualityStandard, True)
  1208. '-------------關閉EXCEL---------------------------------------------------------------------
  1209. xlApp.Cells.Select() : xlApp.Application.WindowState = xlMinimized
  1210. xlBook.Close(False)
  1211. Runtime.InteropServices.Marshal.ReleaseComObject(xlSheet)
  1212. Runtime.InteropServices.Marshal.ReleaseComObject(xlBook)
  1213. Runtime.InteropServices.Marshal.ReleaseComObject(xlApp)
  1214. xlApp.Quit() : xlSheet = Nothing : xlBook = Nothing : xlApp = Nothing : GC.Collect()
  1215. MGB(系統語言字典("H508-121-" & 語言), 1) : 首次開啟 = False
  1216. End If
  1217. End Sub
  1218. Private Shared Function NewMethod(xlBook As Workbook) As Worksheet
  1219. Return CType(xlBook.Worksheets.Add, Worksheet)
  1220. End Function
  1221. Private Sub AA(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Worksheet)
  1222. xlSheet.Cells.Select()
  1223. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  1224. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1225. xlSheet.Rows("1:1").Select : myExcel.Selection.RowHeight = 90 : xlSheet.Rows("2:2").Select : myExcel.Selection.RowHeight = 25
  1226. xlSheet.Rows("3:3").Select : myExcel.Selection.RowHeight = 19 : xlSheet.Rows("5:7").Select : myExcel.Selection.RowHeight = 25
  1227. xlSheet.Rows("8:8").Select : myExcel.Selection.RowHeight = 50 : xlSheet.Rows("9:9").Select : myExcel.Selection.RowHeight = 100
  1228. xlSheet.Rows("10:10").Select : myExcel.Selection.RowHeight = 80 : xlSheet.Rows("13:13").Select : myExcel.Selection.RowHeight = 50
  1229. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 4 : xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 20
  1230. xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 1.7 : xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 30
  1231. xlSheet.Columns("E:E").Select : myExcel.Selection.ColumnWidth = 10 : xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 30
  1232. xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 10 : xlSheet.Columns("H:H").Select : myExcel.Selection.ColumnWidth = 30
  1233. xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 4
  1234. xlSheet.Range("A2:I2").Select()
  1235. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1236. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1237. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 22 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  1238. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1239. xlSheet.Range("A3:I3").Select()
  1240. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1241. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1242. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 14 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  1243. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1244. xlSheet.Range("B5:C10").Select()
  1245. With myExcel.Selection : .HorizontalAlignment = xlGeneral : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1246. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1247. xlSheet.Range("D5:H5").Select()
  1248. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1249. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1250. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1251. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1252. xlSheet.Range("D6:H6").Select()
  1253. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1254. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1255. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1256. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1257. xlSheet.Range("D7:H7").Select()
  1258. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1259. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1260. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1261. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1262. xlSheet.Range("D8:H8").Select()
  1263. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1264. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1265. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1266. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1267. xlSheet.Range("D9:H9").Select()
  1268. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1269. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1270. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1271. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1272. xlSheet.Range("D10:H10").Select()
  1273. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1274. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1275. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1276. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  1277. xlSheet.Range("D12:H14").Select()
  1278. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1279. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1280. xlSheet.Range("A1:I2").Select()
  1281. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1282. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1283. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1284. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1285. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1286. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1287. xlSheet.Range("A3:I3").Select()
  1288. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1289. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1290. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1291. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1292. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1293. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1294. xlSheet.Range("A4:I14").Select()
  1295. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1296. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1297. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1298. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1299. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1300. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1301. xlSheet.Range("D5:H5").Select()
  1302. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1303. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1304. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1305. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1306. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1307. xlSheet.Range("D6:H6").Select()
  1308. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1309. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  1310. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1311. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1312. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1313. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1314. xlSheet.Range("D7:H7").Select()
  1315. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1316. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  1317. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1318. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1319. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1320. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1321. xlSheet.Range("D8:H8").Select()
  1322. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1323. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  1324. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1325. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1326. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1327. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1328. xlSheet.Range("D9:H9").Select()
  1329. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1330. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  1331. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1332. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1333. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1334. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1335. xlSheet.Range("D10:H10").Select()
  1336. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1337. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  1338. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1339. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1340. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1341. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1342. xlSheet.Range("F13").Select()
  1343. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1344. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1345. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1346. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1347. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1348. xlSheet.Range("H13").Select()
  1349. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1350. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  1351. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1352. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  1353. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1354. myExcel.ActiveWindow.DisplayGridlines = False
  1355. xlSheet.Range("B5:B10").Select() : myExcel.Selection.Font.Bold = True : xlSheet.Range("D12:H12").Select() : myExcel.Selection.Font.Bold = True
  1356. xlSheet.Range("F14:H14").Select() : myExcel.Selection.Font.Bold = True
  1357. xlSheet.Range("D8:H10").Select()
  1358. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlTop : .WrapText = True : .Orientation = 0 : .AddIndent = False
  1359. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : End With
  1360. myExcel.Application.PrintCommunication = False : With myExcel.ActiveSheet.PageSetup : .PrintTitleRows = "" : .PrintTitleColumns = "" : End With
  1361. myExcel.Application.PrintCommunication = True : myExcel.ActiveSheet.PageSetup.PrintArea = "" : myExcel.Application.PrintCommunication = False
  1362. With myExcel.ActiveSheet.PageSetup : .LeftHeader = "" : .CenterHeader = "" : .RightHeader = "" : .LeftFooter = "" : .CenterFooter = "" : .RightFooter = ""
  1363. .LeftMargin = myExcel.Application.InchesToPoints(0.236220472440945) : .RightMargin = myExcel.Application.InchesToPoints(0.236220472440945)
  1364. .TopMargin = myExcel.Application.InchesToPoints(0.748031496062992) : .BottomMargin = myExcel.Application.InchesToPoints(0.748031496062992)
  1365. .HeaderMargin = myExcel.Application.InchesToPoints(0.31496062992126) : .FooterMargin = myExcel.Application.InchesToPoints(0.31496062992126)
  1366. .PrintHeadings = False : .PrintGridlines = False : .PrintQuality = 600 : .CenterHorizontally = True : .CenterVertically = False
  1367. .Draft = False : .FirstPageNumber = xlAutomatic : .BlackAndWhite = False : .Zoom = False : .FitToPagesWide = 1 : .FitToPagesTall = False
  1368. .OddAndEvenPagesHeaderFooter = False : .DifferentFirstPageHeaderFooter = False : .ScaleWithDocHeaderFooter = True : .AlignMarginsHeaderFooter = True
  1369. .EvenPage.LeftHeader.Text = "" : .EvenPage.CenterHeader.Text = "" : .EvenPage.RightHeader.Text = "" : .EvenPage.LeftFooter.Text = ""
  1370. .EvenPage.CenterFooter.Text = "" : .EvenPage.RightFooter.Text = "" : .FirstPage.LeftHeader.Text = "" : .FirstPage.CenterHeader.Text = ""
  1371. .FirstPage.RightHeader.Text = "" : .FirstPage.LeftFooter.Text = "" : .FirstPage.CenterFooter.Text = "" : .FirstPage.RightFooter.Text = ""
  1372. End With
  1373. myExcel.Application.PrintCommunication = True
  1374. End Sub
  1375. Private Sub CC(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Worksheet)
  1376. Clipboard.SetDataObject(PictureBox1.Image)
  1377. xlSheet.Range("A1").Select()
  1378. myExcel.ActiveSheet.Pictures.Paste.Select
  1379. myExcel.Selection.ShapeRange.Height = 88
  1380. myExcel.Selection.ShapeRange.IncrementLeft(50)
  1381. myExcel.Selection.ShapeRange.IncrementTop(2)
  1382. End Sub
  1383. Private Sub DD(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Worksheet)
  1384. Clipboard.SetDataObject(PictureBox2.Image)
  1385. xlSheet.Range("A1").Select()
  1386. myExcel.ActiveSheet.Pictures.Paste.Select
  1387. myExcel.Selection.ShapeRange.Height = 88
  1388. myExcel.Selection.ShapeRange.IncrementLeft(50)
  1389. myExcel.Selection.ShapeRange.IncrementTop(2)
  1390. End Sub
  1391. End Class