1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657 |
- Option Strict Off
- Imports Microsoft.Office.Interop.Excel.XlUnderlineStyle
- Imports Microsoft.Office.Interop.Excel.Constants
- Imports Microsoft.Office.Interop.Excel.XlBordersIndex
- Imports Microsoft.Office.Interop.Excel.XlLineStyle
- Imports Microsoft.Office.Interop.Excel.XlBorderWeight
- Imports Microsoft.Office.Interop.Excel.XlThemeFont
- Imports Microsoft.Office.Interop.Excel.XlThemeColor
- Imports Microsoft.Office.Interop.Excel.XlWindowState
- Imports Microsoft.Office.Interop.Excel
- Imports System.IO
-
- Public Class 財務_收支單一覽表
- ReadOnly ds, ds1, ds2, ds3, ds4, ds5 As New DataSet
- Dim DTP As String : Dim N1 As Integer : Dim N2 As Integer
- Dim xlApp As Application
- Dim xlBook As Workbook
- Dim xlSheet As Worksheet
- Dim boo As Boolean
- Dim boo1 As Boolean
- Private Sub Set_清單()
- 日期彙總_dgv.DataSource = Nothing : ds3.Clear()
- 日期彙總_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- 日期彙總_dgv.ColumnHeadersHeight = 25
- 日期彙總_dgv.AllowUserToAddRows = False
- 日期彙總_dgv.RowTemplate.Height = 25
- If 公司編號_cb.Text = "全部" Or 公司編號_cb.Text = "" Then : PA51 = "" : Else : PA51 = " AND (公司編號 LIKE N'" & 公司編號_cb.Text & "')" : End If
- SQL_營運成本收支單一覽表_查詢清單純日期() : da.Fill(ds3) : 日期彙總_dgv.DataSource = ds3.Tables(0) : conn.Close()
- 單據彙總_dgv.Columns(0).FillWeight = 100
- End Sub
- Private Sub Set_清單1()
- 單據彙總_dgv.DataSource = Nothing : ds1.Clear()
- 單據彙總_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- 單據彙總_dgv.ColumnHeadersHeight = 25
- 單據彙總_dgv.AllowUserToAddRows = False
- If 公司編號_cb.Text = "全部" Or 公司編號_cb.Text = "" Then : PA51 = "" : Else : PA51 = " AND (公司編號 LIKE N'" & 公司編號_cb.Text & "')" : End If
- SQL_營運成本收支單一覽表_查詢清單() : da.Fill(ds1) : 單據彙總_dgv.DataSource = ds1.Tables(0) : conn.Close()
- 單據彙總_dgv.RowTemplate.Height = 25
- 單據彙總_dgv.Columns(0).FillWeight = 160 : 單據彙總_dgv.Columns(1).Visible = False : 單據彙總_dgv.Columns(2).FillWeight = 100 : 單據彙總_dgv.Columns(3).Visible = False
- 單據彙總_dgv.Columns(4).FillWeight = 100 : 單據彙總_dgv.Columns(5).Visible = False : 單據彙總_dgv.Columns(6).Visible = False
- End Sub
- Private Sub Set_清單2()
- 財務彙總_dgv.DataSource = Nothing : ds2.Clear()
- 財務彙總_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- 財務彙總_dgv.ColumnHeadersHeight = 25
- 財務彙總_dgv.AllowUserToAddRows = False
- 財務彙總_dgv.RowTemplate.Height = 30
- If 全部_ch.Checked = True And 含稅_ch.Checked = False And 非稅_ch.Checked = False Then
- SQL2 = ""
- ElseIf 全部_ch.Checked = False And 含稅_ch.Checked = True And 非稅_ch.Checked = False Then
- SQL2 = " AND (公帳流水帳.含稅 = 1)"
- ElseIf 全部_ch.Checked = False And 含稅_ch.Checked = False And 非稅_ch.Checked = True Then
- SQL2 = " AND (公帳流水帳.含稅 = 0 OR 公帳流水帳.含稅 IS NULL)"
- End If
- If 公司編號_cb.Text = "全部" Or 公司編號_cb.Text = "" Then : PA51 = "" : Else : PA51 = " AND (公帳控制表.公司編號 LIKE N'" & 公司編號_cb.Text & "')" : End If
- SQL_營運成本收支單一覽表_查詢清單2() : da.Fill(ds2) : 財務彙總_dgv.DataSource = ds2.Tables(0) : conn.Close()
- 財務彙總_dgv.Columns(0).Visible = False : 財務彙總_dgv.Columns(1).FillWeight = 140 : 財務彙總_dgv.Columns(2).FillWeight = 140 : 財務彙總_dgv.Columns(3).FillWeight = 140
- 財務彙總_dgv.Columns(4).FillWeight = 100 : 財務彙總_dgv.Columns(5).FillWeight = 100 : 財務彙總_dgv.Columns(6).FillWeight = 100 : 財務彙總_dgv.Columns(7).FillWeight = 100
- 財務彙總_dgv.Columns(8).FillWeight = 100 : 財務彙總_dgv.Columns(9).FillWeight = 100
- 財務彙總_dgv.Columns(4).Visible = False : 財務彙總_dgv.Columns(5).Visible = False
- If 彙總匯率_ch.Checked = False Then
- 財務彙總_dgv.Columns(8).Visible = False : 財務彙總_dgv.Columns(9).Visible = False
- Else
- 財務彙總_dgv.Columns(8).Visible = False : 財務彙總_dgv.Columns(9).Visible = False
- End If
- 財務彙總_dgv.Columns(6).DefaultCellStyle.Format = "#,##0" : 財務彙總_dgv.Columns(7).DefaultCellStyle.Format = "#,##0" : 財務彙總_dgv.Columns(4).DefaultCellStyle.Format = "#,##0"
- 財務彙總_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
- 財務彙總_dgv.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_dgv.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_dgv.Columns(7).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_dgv.Columns(7).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_dgv.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_dgv.Columns(8).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
- 財務彙總_dgv.Columns(8).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- 財務彙總_dgv.Columns(9).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
- 財務彙總_dgv.Columns(9).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
-
- 財務彙總_dgv.Columns(0).ReadOnly = True : 財務彙總_dgv.Columns(1).ReadOnly = True : 財務彙總_dgv.Columns(2).ReadOnly = True : 財務彙總_dgv.Columns(3).ReadOnly = True
- 財務彙總_dgv.Columns(4).ReadOnly = True : 財務彙總_dgv.Columns(5).ReadOnly = True : 財務彙總_dgv.Columns(6).ReadOnly = True : 財務彙總_dgv.Columns(7).ReadOnly = True
- End Sub
- Private Sub Set_清單3()
- 財務彙總_天_dgv.DataSource = Nothing : ds4.Clear()
- 財務彙總_天_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- 財務彙總_天_dgv.ColumnHeadersHeight = 25
- 財務彙總_天_dgv.AllowUserToAddRows = False
- 財務彙總_天_dgv.RowTemplate.Height = 30
-
- If 全部_ch.Checked = True And 含稅_ch.Checked = False And 非稅_ch.Checked = False Then
- SQL2 = ""
- ElseIf 全部_ch.Checked = False And 含稅_ch.Checked = True And 非稅_ch.Checked = False Then
- SQL2 = " AND (公帳流水帳.含稅 = 1)"
- ElseIf 全部_ch.Checked = False And 含稅_ch.Checked = False And 非稅_ch.Checked = True Then
- SQL2 = " AND (公帳流水帳.含稅 = 0 OR 公帳流水帳.含稅 IS NULL)"
- End If
- If 公司編號_cb.Text = "全部" Or 公司編號_cb.Text = "" Then : PA51 = "" : Else : PA51 = " AND (公帳控制表.公司編號 LIKE N'" & 公司編號_cb.Text & "')" : End If
- SQL_營運成本收支單一覽表_查詢清單3() : da.Fill(ds4) : 財務彙總_天_dgv.DataSource = ds4.Tables(0) : conn.Close()
- 財務彙總_天_dgv.Columns(0).Visible = False : 財務彙總_天_dgv.Columns(1).FillWeight = 140 : 財務彙總_天_dgv.Columns(2).FillWeight = 140 : 財務彙總_天_dgv.Columns(3).FillWeight = 140
- 財務彙總_天_dgv.Columns(4).FillWeight = 100 : 財務彙總_天_dgv.Columns(5).FillWeight = 100 : 財務彙總_天_dgv.Columns(6).FillWeight = 100 : 財務彙總_天_dgv.Columns(7).FillWeight = 100
- 財務彙總_天_dgv.Columns(8).FillWeight = 100 : 財務彙總_天_dgv.Columns(9).FillWeight = 100
- 財務彙總_天_dgv.Columns(4).Visible = False : 財務彙總_天_dgv.Columns(5).Visible = False
- If 彙總匯率_ch.Checked = False Then
- 財務彙總_天_dgv.Columns(8).Visible = False : 財務彙總_天_dgv.Columns(9).Visible = False
- Else
- 財務彙總_天_dgv.Columns(8).Visible = False : 財務彙總_天_dgv.Columns(9).Visible = False
- End If
- 財務彙總_天_dgv.Columns(6).DefaultCellStyle.Format = "#,##0" : 財務彙總_天_dgv.Columns(7).DefaultCellStyle.Format = "#,##0" : 財務彙總_天_dgv.Columns(4).DefaultCellStyle.Format = "#,##0"
- 財務彙總_天_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
- 財務彙總_天_dgv.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_天_dgv.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_天_dgv.Columns(7).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_天_dgv.Columns(7).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_天_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_天_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_天_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_天_dgv.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
- 財務彙總_天_dgv.Columns(8).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
- 財務彙總_天_dgv.Columns(8).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- 財務彙總_天_dgv.Columns(9).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
- 財務彙總_天_dgv.Columns(9).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- 財務彙總_天_dgv.Columns(0).ReadOnly = True : 財務彙總_天_dgv.Columns(1).ReadOnly = True : 財務彙總_天_dgv.Columns(2).ReadOnly = True : 財務彙總_天_dgv.Columns(3).ReadOnly = True
- 財務彙總_天_dgv.Columns(4).ReadOnly = True : 財務彙總_天_dgv.Columns(5).ReadOnly = True : 財務彙總_天_dgv.Columns(6).ReadOnly = True : 財務彙總_天_dgv.Columns(7).ReadOnly = True
- End Sub
- Private Sub Set_費用清單()
- 明細_dgv.DataSource = Nothing : ds.Clear()
- 明細_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- 明細_dgv.ColumnHeadersHeight = 40
- 明細_dgv.AllowUserToAddRows = False
- 明細_dgv.RowTemplate.Height = 35
- If 全部_ch.Checked = True And 含稅_ch.Checked = False And 非稅_ch.Checked = False Then
- SQL2 = ""
- ElseIf 全部_ch.Checked = False And 含稅_ch.Checked = True And 非稅_ch.Checked = False Then
- SQL2 = " AND (公帳流水帳.含稅 = 1)"
- ElseIf 全部_ch.Checked = False And 含稅_ch.Checked = False And 非稅_ch.Checked = True Then
- SQL2 = " AND (公帳流水帳.含稅 = 0 OR 公帳流水帳.含稅 IS NULL)"
- End If
- If 公司編號_cb.Text = "全部" Or 公司編號_cb.Text = "" Then : PA51 = "" : Else : PA51 = " AND (公帳控制表.公司編號 LIKE N'" & 公司編號_cb.Text & "')" : End If
-
- If boo = True Then : PA55 = 申請日期_dtp.Text : Else : PA55 = "" : End If
- If boo1 = True Then
- SQL_營運成本收支單一覽表_查詢費用清單()
- Else
- SQL_營運成本收支單一覽表_查詢清單4()
- End If
- da.Fill(ds) : 明細_dgv.DataSource = ds.Tables(0) : conn.Close()
- 明細_dgv.Columns(0).FillWeight = 50 : 明細_dgv.Columns(1).FillWeight = 250 : 明細_dgv.Columns(2).FillWeight = 250 : 明細_dgv.Columns(3).FillWeight = 380
- 明細_dgv.Columns(6).FillWeight = 140 : 明細_dgv.Columns(7).FillWeight = 140
- 明細_dgv.Columns(9).Visible = False : 明細_dgv.Columns(10).Visible = False : 明細_dgv.Columns(11).Visible = False
- 明細_dgv.Columns(12).Visible = False : 明細_dgv.Columns(4).Visible = False : 明細_dgv.Columns(5).Visible = False : 明細_dgv.Columns(8).Visible = False
- If 彙總匯率_ch.Checked = False Then
- 明細_dgv.Columns(9).Visible = False : 明細_dgv.Columns(10).Visible = False
- Else
- 明細_dgv.Columns(9).Visible = False : 明細_dgv.Columns(10).Visible = False
- End If
- 明細_dgv.Columns(1).ReadOnly = True : 明細_dgv.Columns(2).ReadOnly = True : 明細_dgv.Columns(9).ReadOnly = True : 明細_dgv.Columns(10).ReadOnly = True
- 明細_dgv.Columns(4).DefaultCellStyle.Format = "#,##0" : 明細_dgv.Columns(5).DefaultCellStyle.Format = "#,##0" : 明細_dgv.Columns(6).DefaultCellStyle.Format = "#,##0"
- 明細_dgv.Columns(7).DefaultCellStyle.Format = "#,##0"
- 明細_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 明細_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
- 明細_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 明細_dgv.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
- 明細_dgv.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 明細_dgv.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
- 明細_dgv.Columns(7).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 明細_dgv.Columns(7).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
- 明細_dgv.Columns(9).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : 明細_dgv.Columns(9).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- 明細_dgv.Columns(10).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : 明細_dgv.Columns(10).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- 明細_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : 明細_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- 台幣現金_tb.Text = "0" : 台幣支出_tb.Text = "0" : 台幣現金餘額_tb.Text = "0" : 台幣零用金_tb.Text = "0" : 台幣支票_tb.Text = "0"
- 人民幣零用金_tb.Text = "0" : 人民幣支票_tb.Text = "0" : 人民幣現金_tb.Text = "0" : 人民幣支出_tb.Text = "0" : 人民幣現金餘額_tb.Text = "0"
- For i As Integer = 0 To 明細_dgv.Rows.Count - 1
- 明細_dgv.Rows(i).Cells("項次").Value = i + 1
- If 明細_dgv.Rows(i).Cells("幣別").Value = "台幣現金" Then
- 台幣現金_tb.Text = Val(台幣現金_tb.Text) + 明細_dgv.Rows(i).Cells("收入").Value
- 台幣支出_tb.Text = Val(台幣支出_tb.Text) + 明細_dgv.Rows(i).Cells("支出").Value
- 台幣零用金_tb.Text = Val(台幣零用金_tb.Text) + 明細_dgv.Rows(i).Cells("零用金").Value
- 台幣支票_tb.Text = Val(台幣支票_tb.Text) + 明細_dgv.Rows(i).Cells("支票").Value
- End If
- If 明細_dgv.Rows(i).Cells("幣別").Value = "人民幣現金" Then
- 人民幣現金_tb.Text = Val(人民幣現金_tb.Text) + 明細_dgv.Rows(i).Cells("收入").Value
- 人民幣支出_tb.Text = Val(人民幣支出_tb.Text) + 明細_dgv.Rows(i).Cells("支出").Value
-
- 人民幣零用金_tb.Text = Val(人民幣零用金_tb.Text) + 明細_dgv.Rows(i).Cells("零用金").Value
- 人民幣支票_tb.Text = Val(人民幣支票_tb.Text) + 明細_dgv.Rows(i).Cells("支票").Value
- End If
- Next i
- 台幣現金餘額_tb.Text = Val(台幣零用金_tb.Text) + Val(台幣現金_tb.Text) - Val(台幣支出_tb.Text)
- 人民幣現金餘額_tb.Text = Val(人民幣零用金_tb.Text) + Val(人民幣現金_tb.Text) - Val(人民幣支出_tb.Text)
- 台幣現金_tb.Text = Strings.Format(Val(台幣現金_tb.Text), "#,##0") : 台幣支出_tb.Text = Strings.Format(Val(台幣支出_tb.Text), "#,##0")
- 台幣現金餘額_tb.Text = Strings.Format(Val(台幣現金餘額_tb.Text), "#,##0")
- 台幣零用金_tb.Text = Strings.Format(Val(台幣零用金_tb.Text), "#,##0") : 台幣支票_tb.Text = Strings.Format(Val(台幣支票_tb.Text), "#,##0")
- 人民幣零用金_tb.Text = Strings.Format(Val(人民幣零用金_tb.Text), "#,##0") : 人民幣支票_tb.Text = Strings.Format(Val(人民幣支票_tb.Text), "#,##0")
- 人民幣現金_tb.Text = Strings.Format(Val(人民幣現金_tb.Text), "#,##0")
- 人民幣支出_tb.Text = Strings.Format(Val(人民幣支出_tb.Text), "#,##0") : 人民幣現金餘額_tb.Text = Strings.Format(Val(人民幣現金餘額_tb.Text), "#,##0")
- End Sub
- Private Sub 日期格式()
- If 會計月_ch.Checked = True Then
- '-------------日期一----------------------------------------------------------------------------------------
- DTP = Strings.Left(Strings.Format(開始日期_dtp.Value, "yyyy/MM/dd"), 8) & "01" : 開始日期_dtp.Value = DTP
- 開始日期_dtp.Value = 結束日期_dtp.Value.AddMonths(-1)
- DTP = Strings.Left(Strings.Format(開始日期_dtp.Value, "yyyy/MM/dd"), 8) & "26" : 開始日期_dtp.Value = DTP
- '-------------日期二----------------------------------------------------------------------------------------
- DTP = Strings.Left(Strings.Format(結束日期_dtp.Value, "yyyy/MM/dd"), 8) & "25" : 結束日期_dtp.Value = DTP
- Else
- 開始日期_dtp.Value = 結束日期_dtp.Value
- '-------------日期一----------------------------------------------------------------------------------------
- DTP = Strings.Left(Strings.Format(開始日期_dtp.Value, "yyyy/MM/dd"), 8) & "01" : 開始日期_dtp.Value = DTP
- '-------------日期二----------------------------------------------------------------------------------------
- DTP = Strings.Left(Strings.Format(結束日期_dtp.Value, "yyyy/MM/dd"), 8) & "01" : 結束日期_dtp.Value = DTP
- 結束日期_dtp.Value = 結束日期_dtp.Value.AddMonths(1) : 結束日期_dtp.Value = 結束日期_dtp.Value.AddDays(-1)
- End If
- End Sub
- Private Sub 載入公司編號cb()
- SQL_公司編號_下拉清單() : 公司編號_cb.Items.Clear() : 公司編號_cb.Items.Add("全部")
- While (dr.Read()) : 公司編號_cb.Items.Add(dr("公司編號")) : End While : conn.Close()
- End Sub
-
- Private Sub 營運成本收支單一覽表_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Me.MdiParent = ICS_ASMS_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
- 載入公司編號cb()
- DTP = Strings.Left(Strings.Format(Today(), "yyyy/MM/dd"), 8) & "01"
- 開始日期_dtp.Value = DTP : 結束日期_dtp.Value = Today() : 支付單列印成EXCEL.Enabled = False
- 日期格式() : 明細_rb.Checked = True : 財務彙總_天_dgv.Visible = False
- If 公司 = True Then
- Else
- 公司編號_lb.Visible = False : 公司編號_cb.Visible = False
- End If
- SQL_讀取公司名稱()
- If dr.Read() Then
- 公司名稱.Text = dr("公司名稱")
- End If
- conn.Close()
- End Sub
- Dim 已超出 As Boolean
- Private Sub 財務彙總_dgv_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 財務彙總_dgv.MouseUp
- 'If 財務彙總_dgv.SelectedCells.Count = 1 Then : MsgBox(財務彙總_dgv.SelectedCells(0).ColumnIndex & " " & 財務彙總_dgv.SelectedCells(0).RowIndex) : End If
- If 財務彙總_dgv.SelectedCells.Count = 1 Then : 已超出 = False : End If
- If 財務彙總_dgv.SelectedCells.Count > 0 Then
- If 財務彙總_dgv.SelectedCells(0).ColumnIndex >= 4 And 財務彙總_dgv.SelectedCells(0).ColumnIndex <= 7 Then
- If 已超出 = False Then
- Dim x As Double = 0
- For i As Integer = 0 To 財務彙總_dgv.SelectedCells.Count - 1
- x += Val(財務彙總_dgv.Rows(財務彙總_dgv.SelectedCells.Item(i).RowIndex).Cells(財務彙總_dgv.SelectedCells.Item(i).ColumnIndex).Value)
- Next i : ICS_ASMS_ERP_SYS.合計_TSSL.Text = "合計 : " & Strings.Format(x, "#,##0")
- Else : ICS_ASMS_ERP_SYS.合計_TSSL.Text = "合計 : " & Strings.Format(0, "#,##0") : End If
- Else : 已超出 = True : ICS_ASMS_ERP_SYS.合計_TSSL.Text = "合計 : " & Strings.Format(0, "#,##0")
- End If
- End If
- End Sub
- Private Sub 明細_dgv_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 明細_dgv.MouseUp
- 'If 明細_dgv.SelectedCells.Count = 1 Then : MsgBox(明細_dgv.SelectedCells(0).ColumnIndex & " " & 明細_dgv.SelectedCells(0).RowIndex) : End If
- If 明細_dgv.SelectedCells.Count = 1 Then : 已超出 = False : End If
- If 明細_dgv.SelectedCells.Count > 0 Then
- If 明細_dgv.SelectedCells(0).ColumnIndex >= 4 And 明細_dgv.SelectedCells(0).ColumnIndex <= 7 Then
- If 已超出 = False Then
- Dim x As Double = 0
- For i As Integer = 0 To 明細_dgv.SelectedCells.Count - 1
- x += Val(明細_dgv.Rows(明細_dgv.SelectedCells.Item(i).RowIndex).Cells(明細_dgv.SelectedCells.Item(i).ColumnIndex).Value)
- Next i : ICS_ASMS_ERP_SYS.合計_TSSL.Text = "合計 : " & Strings.Format(x, "#,##0")
- Else : ICS_ASMS_ERP_SYS.合計_TSSL.Text = "合計 : " & Strings.Format(0, "#,##0") : End If
- Else : 已超出 = True : ICS_ASMS_ERP_SYS.合計_TSSL.Text = "合計 : " & Strings.Format(0, "#,##0")
- End If
- End If
- End Sub
- Private Sub 財務彙總_dgv_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles 財務彙總_dgv.CellClick
- If e.RowIndex = -1 Then : Else
- PA56 = 財務彙總_dgv(3, e.RowIndex).Value.ToString
- boo1 = False
- 支付單列印成EXCEL.Enabled = True
- Set_費用清單()
- End If
- End Sub
- Private Sub 單據彙總_dgv_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles 單據彙總_dgv.CellClick
- If e.RowIndex = -1 Then : Else
-
- 收支單號_tb.Text = 單據彙總_dgv(0, e.RowIndex).Value.ToString : 驗證碼_tb.Text = 單據彙總_dgv(6, e.RowIndex).Value.ToString
- 申請人_tb.Text = 單據彙總_dgv(1, e.RowIndex).Value.ToString : 申請日期_dtp.Value = 單據彙總_dgv(2, e.RowIndex).Value.ToString
- 審核人_tb.Text = 單據彙總_dgv(3, e.RowIndex).Value.ToString : 圖片編碼_tb.Text = 單據彙總_dgv(5, e.RowIndex).Value.ToString
- If 單據彙總_dgv(4, e.RowIndex).Value.ToString = "" Then
- 審核日期_dtp.Value = 單據彙總_dgv(2, e.RowIndex).Value.ToString
- Else
- 審核日期_dtp.Value = 單據彙總_dgv(4, e.RowIndex).Value.ToString
- End If
- Set_費用清單()
- End If
- End Sub
- Private Sub 明細_dgv_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles 明細_dgv.CellClick
- 'If e.RowIndex = -1 Then : Else
- ' Dim NV1 As Integer
- ' 收支單號_tb.Text = 明細_dgv(0, e.RowIndex).Value.ToString
- ' For i As Integer = 0 To 單據彙總_dgv.Rows.Count - 1
- ' If 收支單號_tb.Text = 單據彙總_dgv(0, i).Value.ToString Then : NV1 = i : Exit For : End If
- ' Next
- ' 收支單號_tb.Text = 單據彙總_dgv(0, NV1).Value.ToString : 驗證碼_tb.Text = 單據彙總_dgv(6, NV1).Value.ToString
- ' 申請人_tb.Text = 單據彙總_dgv(1, NV1).Value.ToString : 申請日期_dtp.Value = 單據彙總_dgv(2, NV1).Value.ToString
- ' 審核人_tb.Text = 單據彙總_dgv(3, NV1).Value.ToString : 圖片編碼_tb.Text = 單據彙總_dgv(5, NV1).Value.ToString
- ' If 單據彙總_dgv(4, NV1).Value.ToString = "" Then
- ' 審核日期_dtp.Value = 單據彙總_dgv(2, NV1).Value.ToString
- ' Else
- ' 審核日期_dtp.Value = 單據彙總_dgv(4, NV1).Value.ToString
- ' End If
- ' Set_費用清單()
- 'End If
- End Sub
- Private Sub 日期彙總_dgv_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles 日期彙總_dgv.CellClick
- If e.RowIndex = -1 Then : Else
- boo1 = True
- boo = True : 支付單列印成EXCEL.Enabled = True
- If 日期浮動_cb.Checked = True Then
- 結束日期_dtp.Value = 日期彙總_dgv(0, e.RowIndex).Value.ToString
- End If
- 申請日期_dtp.Value = 日期彙總_dgv(0, e.RowIndex).Value.ToString : Set_費用清單() : Set_清單3() : Set_清單2()
- If 單據彙總_dgv.Rows.Count > 0 Then
- 圖片編碼_tb.Text = 單據彙總_dgv(5, 0).Value.ToString
- End If
- 憑證張數_tb.Text = ""
-
- End If
- End Sub
- Private Sub 單據彙總_dgv_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 單據彙總_dgv.RowPostPaint
- Dim linePen As New Pen(Color.Blue, 2) : Dim linePen1 As New Pen(Color.Red, 2) : Dim linePen2 As New Pen(Color.Green, 2)
- If e.RowIndex = 單據彙總_dgv.Rows.Count - 1 Then
- Exit Sub
- Else
- If 單據彙總_dgv(2, e.RowIndex).Value.ToString <> 單據彙總_dgv(2, e.RowIndex + 1).Value.ToString Then
- Dim startX As Integer = IIf(單據彙總_dgv.RowHeadersVisible, 單據彙總_dgv.RowHeadersWidth, 0)
- Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
- Dim endX As Integer = startX + 單據彙總_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 單據彙總_dgv.HorizontalScrollingOffset
- e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
- Exit Sub
- End If
- End If
- End Sub
- Private Sub 財務彙總_dgv_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 財務彙總_dgv.RowPostPaint
- Dim linePen As New Pen(Color.Blue, 2) : Dim linePen1 As New Pen(Color.Red, 2) : Dim linePen2 As New Pen(Color.Green, 2)
- If e.RowIndex = 財務彙總_dgv.Rows.Count - 1 Then
- Exit Sub
- Else
- If 財務彙總_dgv(0, e.RowIndex).Value.ToString <> 財務彙總_dgv(0, e.RowIndex + 1).Value.ToString Then
- Dim startX As Integer = IIf(財務彙總_dgv.RowHeadersVisible, 財務彙總_dgv.RowHeadersWidth, 0)
- Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
- Dim endX As Integer = startX + 財務彙總_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 財務彙總_dgv.HorizontalScrollingOffset
- e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
- Exit Sub
- End If
- If 財務彙總_dgv(8, e.RowIndex).Value.ToString <> 財務彙總_dgv(8, e.RowIndex + 1).Value.ToString Then
- Dim startX As Integer = IIf(財務彙總_dgv.RowHeadersVisible, 財務彙總_dgv.RowHeadersWidth, 0)
- Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
- Dim endX As Integer = startX + 財務彙總_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 財務彙總_dgv.HorizontalScrollingOffset
- e.Graphics.DrawLine(linePen2, startX, startY, endX, startY)
- Exit Sub
- End If
- If 財務彙總_dgv(1, e.RowIndex).Value.ToString <> 財務彙總_dgv(1, e.RowIndex + 1).Value.ToString Then
- Dim startX As Integer = IIf(財務彙總_dgv.RowHeadersVisible, 財務彙總_dgv.RowHeadersWidth, 0)
- Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
- Dim endX As Integer = startX + 財務彙總_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 財務彙總_dgv.HorizontalScrollingOffset
- e.Graphics.DrawLine(linePen1, startX, startY, endX, startY)
- Exit Sub
- End If
- End If
- End Sub
- Private Sub 日期浮動_cb_CheckedChanged(sender As Object, e As EventArgs) Handles 日期浮動_cb.Click
- If 日期浮動_cb.Checked = False Then
- 日期浮動_cb.Checked = False : 當月_bt.PerformClick()
- End If
- End Sub
- Private Sub 全部_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 全部_ch.Click
- 全部_ch.Checked = True : 含稅_ch.Checked = False : 非稅_ch.Checked = False : Set_費用清單() : Set_清單() : Set_清單2() : 彙總計算()
- End Sub
- Private Sub 含稅_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 含稅_ch.Click
- 全部_ch.Checked = False : 含稅_ch.Checked = True : 非稅_ch.Checked = False : Set_費用清單() : Set_清單() : Set_清單2() : 彙總計算()
- End Sub
- Private Sub 非稅_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 非稅_ch.Click
- 全部_ch.Checked = False : 含稅_ch.Checked = False : 非稅_ch.Checked = True : Set_費用清單() : Set_清單() : Set_清單2() : 彙總計算()
- End Sub
- Private Sub 當日_bt_Click(sender As Object, e As EventArgs) Handles 當日_bt.Click
- 中間日期_dtp.Value = Today
- 日期浮動_cb.Checked = False : DTP = Strings.Format(Today(), "yyyy/MM/dd")
- 開始日期_dtp.Value = DTP : 結束日期_dtp.Value = DTP
- boo = False
- Set_費用清單() : Set_清單() : Set_清單2() : 彙總計算()
- End Sub
- Private Sub 當月_bt_Click(sender As Object, e As EventArgs) Handles 當月_bt.Click
- 中間日期_dtp.Value = Today
- 日期浮動_cb.Checked = False : DTP = Strings.Left(Strings.Format(Today(), "yyyy/MM/dd"), 8) & "01"
- 開始日期_dtp.Value = DTP : 結束日期_dtp.Value = Today()
- boo = False
- Set_費用清單() : Set_清單() : Set_清單2() : 彙總計算()
- End Sub
- Private Sub 彙總計算()
- If 明細_rb.Checked = False And 彙總_rb.Checked = True Then
- 支付單列印成EXCEL.Enabled = False
- 台幣現金_tb.Text = "0" : 台幣支出_tb.Text = "0" : 台幣現金餘額_tb.Text = "0" : 台幣零用金_tb.Text = "0" : 台幣支票_tb.Text = "0"
- 人民幣零用金_tb.Text = "0" : 人民幣支票_tb.Text = "0" : 人民幣現金_tb.Text = "0" : 人民幣支出_tb.Text = "0" : 人民幣現金餘額_tb.Text = "0"
- For i As Integer = 0 To 財務彙總_dgv.Rows.Count - 1
- If 財務彙總_dgv.Rows(i).Cells("幣別").Value = "台幣現金" Then
- 台幣現金_tb.Text = Val(台幣現金_tb.Text) + 財務彙總_dgv.Rows(i).Cells("收入").Value
- 台幣支出_tb.Text = Val(台幣支出_tb.Text) + 財務彙總_dgv.Rows(i).Cells("支出").Value
- 台幣零用金_tb.Text = Val(台幣零用金_tb.Text) + 財務彙總_dgv.Rows(i).Cells("零用金").Value
- 台幣支票_tb.Text = Val(台幣支票_tb.Text) + 財務彙總_dgv.Rows(i).Cells("支票").Value
- End If
- If 財務彙總_dgv.Rows(i).Cells("幣別").Value = "人民幣現金" Then
- If 財務彙總_dgv.Rows(i).Cells("主項").Value <> "上月結存" Then
- 人民幣現金_tb.Text = Val(人民幣現金_tb.Text) + 財務彙總_dgv.Rows(i).Cells("收入").Value
- 人民幣支出_tb.Text = Val(人民幣支出_tb.Text) + 財務彙總_dgv.Rows(i).Cells("支出").Value
- 人民幣零用金_tb.Text = Val(人民幣零用金_tb.Text) + 財務彙總_dgv.Rows(i).Cells("零用金").Value
- 人民幣支票_tb.Text = Val(人民幣支票_tb.Text) + 財務彙總_dgv.Rows(i).Cells("支票").Value
- End If
- End If
- Next i
- 台幣現金餘額_tb.Text = Val(台幣零用金_tb.Text) + Val(台幣現金_tb.Text) - Val(台幣支出_tb.Text)
- 人民幣現金餘額_tb.Text = Val(人民幣零用金_tb.Text) + Val(人民幣現金_tb.Text) - Val(人民幣支出_tb.Text)
- 台幣現金_tb.Text = Strings.Format(Val(台幣現金_tb.Text), "#,##0") : 台幣支出_tb.Text = Strings.Format(Val(台幣支出_tb.Text), "#,##0")
- 台幣現金餘額_tb.Text = Strings.Format(Val(台幣現金餘額_tb.Text), "#,##0")
- 台幣零用金_tb.Text = Strings.Format(Val(台幣零用金_tb.Text), "#,##0") : 台幣支票_tb.Text = Strings.Format(Val(台幣支票_tb.Text), "#,##0")
- 人民幣零用金_tb.Text = Strings.Format(Val(人民幣零用金_tb.Text), "#,##0") : 人民幣支票_tb.Text = Strings.Format(Val(人民幣支票_tb.Text), "#,##0")
- 人民幣現金_tb.Text = Strings.Format(Val(人民幣現金_tb.Text), "#,##0")
- 人民幣支出_tb.Text = Strings.Format(Val(人民幣支出_tb.Text), "#,##0") : 人民幣現金餘額_tb.Text = Strings.Format(Val(人民幣現金餘額_tb.Text), "#,##0")
- End If
- End Sub
- Private Sub 上個月_bt_Click(sender As Object, e As EventArgs) Handles 上個月_bt.Click
- 日期浮動_cb.Checked = False
- If 會計月_ch.Checked = True Then
- 中間日期_dtp.Value = 中間日期_dtp.Value.AddMonths(-1)
- 開始日期_dtp.Value = 中間日期_dtp.Value
- 結束日期_dtp.Value = 中間日期_dtp.Value
- Else
- 中間日期_dtp.Value = 中間日期_dtp.Value.AddMonths(-1)
- 開始日期_dtp.Value = 中間日期_dtp.Value
- 結束日期_dtp.Value = 中間日期_dtp.Value
- End If
- boo = False
- 日期格式() : Set_費用清單() : Set_清單() : Set_清單2() : 彙總計算()
- End Sub
- Private Sub 下個月_bt_Click(sender As Object, e As EventArgs) Handles 下個月_bt.Click
- 日期浮動_cb.Checked = False
- If 會計月_ch.Checked = True Then
- 中間日期_dtp.Value = 中間日期_dtp.Value.AddMonths(1)
- 開始日期_dtp.Value = 中間日期_dtp.Value
- 結束日期_dtp.Value = 中間日期_dtp.Value
- Else
- 中間日期_dtp.Value = 中間日期_dtp.Value.AddMonths(1)
- 開始日期_dtp.Value = 中間日期_dtp.Value
- 結束日期_dtp.Value = 中間日期_dtp.Value
- End If : boo = False : 日期格式() : Set_費用清單() : Set_清單() : Set_清單2() : 彙總計算()
- End Sub
- Private Sub 開始日期_dtp_ValueChanged(sender As Object, e As EventArgs) Handles 開始日期_dtp.ValueChanged
- If 日期浮動_cb.Checked = True Then
- Set_清單1() : Set_清單2() : 彙總計算()
- Else
- Set_清單1() : Set_清單() : Set_清單2() : 彙總計算()
- End If
- End Sub
- Private Sub 結束日期_dtp_ValueChanged(sender As Object, e As EventArgs) Handles 結束日期_dtp.ValueChanged
- If 日期浮動_cb.Checked = True Then
- Set_清單1() : Set_清單2() : 彙總計算()
- Else
- Set_清單1() : Set_清單() : Set_清單2() : 彙總計算()
- End If
- End Sub
- Private Sub 會計月_CheckedChanged(sender As Object, e As EventArgs) Handles 會計月_ch.Click
- 會計月_ch.Checked = True : 一般月_ch.Checked = False : 日期格式() : Set_費用清單() : Set_清單() : Set_清單2() : 彙總計算()
- End Sub
- Private Sub 一般月_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 一般月_ch.Click
- 會計月_ch.Checked = False : 一般月_ch.Checked = True : 日期格式() : Set_費用清單() : Set_清單() : Set_清單2() : 彙總計算()
- End Sub
- Private Sub 明細_rb_CheckedChanged(sender As Object, e As EventArgs) Handles 明細_rb.Click
- 明細_dgv.Visible = True : 財務彙總_天_dgv.Visible = False
- 明細_rb.Checked = True : 彙總_rb.Checked = False
- 台幣現金_tb.Text = "0" : 台幣支出_tb.Text = "0" : 台幣現金餘額_tb.Text = "0" : 台幣零用金_tb.Text = "0" : 台幣支票_tb.Text = "0" ': 單據彙總_dgv.Enabled = True
- End Sub
- Private Sub 彙總_rb_CheckedChanged(sender As Object, e As EventArgs) Handles 彙總_rb.Click
- 明細_dgv.Visible = False : 財務彙總_天_dgv.Visible = True
- 明細_rb.Checked = False : 彙總_rb.Checked = True
- 收支單號_tb.Text = "" : 申請人_tb.Text = "" : 審核人_tb.Text = "" : 明細_dgv.DataSource = Nothing : ds.Clear() ': 單據彙總_dgv.Enabled = False
- 彙總計算()
- End Sub
- Private Sub 圖片編碼_tb_TextChanged(sender As Object, e As EventArgs) Handles 圖片編碼_tb.TextChanged
- SQL_營運成本收支單一覽表_查詢簽名檔圖片()
- While dr.Read() = True
- Dim unused As Byte() = New Byte(-1) {}
- Dim bytes As Byte() = DirectCast(dr.Item("簽名檔圖片"), Byte())
- Dim oStream As New MemoryStream(bytes)
- 簽名圖_pb.Image = Bitmap.FromStream(oStream)
- End While
- conn.Close()
- 簽名圖_pb.SizeMode = 4
- End Sub
- Private Sub 彙總匯率_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 彙總匯率_ch.Click
- Set_清單() : Set_清單2()
- End Sub
- Private Sub 支付單列印成EXCEL_Click(sender As Object, e As EventArgs) Handles 支付單列印成EXCEL.Click
-
- If 明細_rb.Checked = False And 彙總_rb.Checked = True Then
- MsgBox("請點選明細才能列印")
- ElseIf 明細_rb.Checked = True And 彙總_rb.Checked = False Then
- xlApp = CType(CreateObject("Excel.Application"), Application)
- xlBook = xlApp.Workbooks.Add
- xlApp.DisplayAlerts = True
- xlBook.Activate()
- xlSheet = NewMethod(xlBook)
- xlSheet.Activate()
- xlApp.Visible = True
- xlApp.Application.WindowState = xlMaximized
- Dim dat As String = 明細_dgv.Rows(0).Cells("支付單號").Value.ToString
- Dim startIndex As Integer = dat.IndexOf("-") + 1
- Dim datePart As String
- Dim dateValue As DateTime
- Dim dat1 As String
- If boo1 = True Then
- datePart = dat.Substring(startIndex, 8)
- If DateTime.TryParseExact(datePart, "yyyyMMdd", Nothing, System.Globalization.DateTimeStyles.None, dateValue) Then
- Dim formattedDate As String = dateValue.ToString("yyyy/MM/dd")
- dat1 = formattedDate
- Else
- dat1 = "無效日期"
- End If
- Else
- datePart = DateTime.Now.ToString("yyyyMM")
- dat1 = DateTime.Now.ToString("yyyy/MM")
- End If
- Dim firstCellValue As Object = 明細_dgv.Rows(0).Cells("會計科目").Value
- Dim allSame As Boolean = True
-
- For i As Integer = 1 To 明細_dgv.Rows.Count - 1
- If Not Object.Equals(明細_dgv.Rows(i).Cells("會計科目").Value, firstCellValue) Then
- allSame = False
- Exit For
- End If
- Next
- If allSame Then
- xlSheet.Cells(2, 3) = 明細_dgv.Rows(0).Cells("會計科目").Value & "-用途說明"
- Else
- xlSheet.Cells(2, 3) = "用途說明"
- End If
-
- xlSheet.Cells(1, 1) = 公司名稱.Text & "收支粘貼憑證用紙-" & dat1
- xlSheet.Cells(2, 1) = "憑證編號" : xlSheet.Cells(2, 2) = "編號" : xlSheet.Cells(2, 9) = "金額"
- xlSheet.Cells(2, 10) = "附件" : xlSheet.Cells(3, 10) = "憑證" : xlSheet.Cells(2, 8) = "收" & vbLf & "支"
- xlSheet.Cells(4, 10) = 憑證張數_tb.Text & vbCrLf & "張"
- If 顯示單據_cb.Checked = True Then
- xlSheet.Cells(2, 7) = "單據" & vbLf & "編號"
- End If
- For i As Integer = 0 To 明細_dgv.Rows.Count - 1
- xlSheet.Cells(i + 4, 2) = i + 1
- If allSame Then
- xlSheet.Cells(i + 4, 3) = 明細_dgv.Rows(i).Cells("用途").Value
- If 顯示單據_cb.Checked = True Then
- xlSheet.Cells(i + 4, 7) = "'" + 明細_dgv.Rows(i).Cells("票期").Value
- End If
- Else
- xlSheet.Cells(i + 4, 3) = 明細_dgv.Rows(i).Cells("會計科目").Value
- xlSheet.Cells(i + 4, 4) = 明細_dgv.Rows(i).Cells("用途").Value
- If 顯示單據_cb.Checked = True Then
- xlSheet.Cells(i + 4, 7) = "'" + 明細_dgv.Rows(i).Cells("票期").Value
- End If
- End If
- xlSheet.Cells(i + 4, 11) = 明細_dgv.Rows(i).Cells("用途").Value
- If 明細_dgv.Rows(i).Cells("收入").Value = 0 And 明細_dgv.Rows(i).Cells("支出").Value <> 0 Then
- xlSheet.Cells(i + 4, 8) = "支"
- Dim value1 As Double = Convert.ToDouble(明細_dgv.Rows(i).Cells("支出").Value)
- Dim formattedValue1 As String = value1.ToString("#,##0")
- xlSheet.Cells(i + 4, 9) = formattedValue1
- 'Dim str As String = 大寫轉換(明細_dgv.Rows(i).Cells("支出").Value)
- 'xlSheet.Cells(i + 4, 9) = str & " 元整"
- ElseIf 明細_dgv.Rows(i).Cells("收入").Value <> 0 And 明細_dgv.Rows(i).Cells("支出").Value = 0 Then
- xlSheet.Cells(i + 4, 8) = "收"
- Dim value2 As Double = Convert.ToDouble(明細_dgv.Rows(i).Cells("收入").Value)
- Dim formattedValue2 As String = value2.ToString("#,##0")
- xlSheet.Cells(i + 4, 9) = formattedValue2
- 'Dim str As String = 大寫轉換(明細_dgv.Rows(i).Cells("收入").Value)
- 'xlSheet.Cells(i + 4, 9) = str & " 元整"
- End If
- N2 = i + 4
- Next i
-
-
- Dim 台幣現金餘額 As Decimal
- If Decimal.TryParse(台幣現金餘額_tb.Text, 台幣現金餘額) Then
- If 台幣現金餘額 > 0 Then
- xlSheet.Cells(N2 + 1, 2) = "合計收入 : "
- Else
- xlSheet.Cells(N2 + 1, 2) = "合計支出 : "
- End If
- If 台幣現金餘額 < 0 Then
- 台幣現金餘額 = Math.Abs(台幣現金餘額)
- End If
- Dim value As Double = 台幣現金餘額
- Dim formattedValue As String = value.ToString("#,##0")
- xlSheet.Cells(N2 + 1, 9) = formattedValue
- 'Dim str1 As String = 大寫轉換(台幣現金餘額.ToString())
- 'xlSheet.Cells(N2 + 1, 9) = str1 & " 元整"
- End If
-
- SQL_公司稱謂()
- If dr.Read() Then
- xlSheet.Cells(N2 + 2, 7) = If(Not IsDBNull(dr("編號一")), dr("編號一").ToString(), "")
- xlSheet.Cells(N2 + 2, 6) = If(Not IsDBNull(dr("編號二")), dr("編號二").ToString(), "")
- xlSheet.Cells(N2 + 2, 5) = If(Not IsDBNull(dr("編號三")), dr("編號三").ToString(), "")
- xlSheet.Cells(N2 + 2, 4) = If(Not IsDBNull(dr("編號四")), dr("編號四").ToString(), "")
- xlSheet.Cells(N2 + 2, 3) = If(Not IsDBNull(dr("編號五")), dr("編號五").ToString(), "")
- xlSheet.Cells(N2 + 2, 1) = If(Not IsDBNull(dr("編號六")), dr("編號六").ToString(), "")
- xlSheet.Cells(N2 + 2, 9) = If(Not IsDBNull(dr("編號七")), dr("編號七").ToString(), "")
- End If
- AA(xlApp, xlSheet, allSame)
- xlApp.Sheets(2).Delete : xlSheet.PageSetup.PrintArea = ""
- '----轉成PDF-----
- Dim pdfFolderPath As String = Path.Combine(System.Windows.Forms.Application.StartupPath, "pdf")
- If Not Directory.Exists(pdfFolderPath) Then
- Directory.CreateDirectory(pdfFolderPath)
- End If
- Dim pdfFilePath As String = Path.Combine(pdfFolderPath, datePart & "-傳票.pdf")
- xlBook.Sheets(1).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, pdfFilePath, XlFixedFormatQuality.xlQualityStandard, True)
- '--------
- xlApp.Cells.Select() : xlApp.Application.WindowState = xlMinimized : xlBook.Close(False)
- Runtime.InteropServices.Marshal.ReleaseComObject(xlSheet)
- Runtime.InteropServices.Marshal.ReleaseComObject(xlBook)
- Runtime.InteropServices.Marshal.ReleaseComObject(xlApp)
- xlApp.Quit() : xlSheet = Nothing : xlBook = Nothing : xlApp = Nothing : GC.Collect()
- Try
- Dim chromePath As String = "C:\Program Files\Google\Chrome\Application\chrome.exe"
- If System.IO.File.Exists(chromePath) Then
- Dim process As New Process()
- process.StartInfo.FileName = "chrome"
- process.StartInfo.Arguments = """" & pdfFilePath & """"
- process.Start()
- Else : Dim edgePath As String = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
- If System.IO.File.Exists(edgePath) Then
- Dim process As New Process()
- process.StartInfo.FileName = "msedge"
- process.StartInfo.Arguments = """" & pdfFilePath & """"
- process.Start()
- Else
- Process.Start(pdfFilePath)
- End If
- End If
- Catch ex As Exception
- MsgBox("以存檔至桌面 。" & vbCrLf & "檔案名稱:" & datePart & "-結帳單.pdf")
- End Try
- End If
-
- End Sub
- Private Shared Function NewMethod(xlBook As Workbook) As Worksheet
- Return CType(xlBook.Worksheets.Add, Worksheet)
- End Function
- Private Sub AA(ByVal myExcel As Application, ByVal xlSheet As Worksheet, ByVal allSame As Boolean)
- xlSheet.Activate() ' 激活工作表
- xlSheet.Parent.Windows(1).View = XlWindowView.xlPageLayoutView
- xlSheet.Cells.Select()
- With myExcel.Selection.Font
- .Name = "標楷體"
- .Size = 12
- .Strikethrough = False
- .Superscript = False
- .Subscript = False
- .OutlineFont = False
- .Shadow = False
- .Underline = xlUnderlineStyleNone
- .ThemeColor = xlThemeColorLight1
- .TintAndShade = 0
- .ThemeFont = xlThemeFontNone
- End With
- xlSheet.Range("A2:J" & N2 + 3).Select()
- myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone
- myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft)
- .LineStyle = xlContinuous
- .ColorIndex = 0
- .TintAndShade = 0
- .Weight = xlThin
- End With
- With myExcel.Selection.Borders(xlEdgeTop)
- .LineStyle = xlContinuous
- .ColorIndex = 0
- .TintAndShade = 0
- .Weight = xlThin
- End With
- With myExcel.Selection.Borders(xlEdgeBottom)
- .LineStyle = xlContinuous
- .ColorIndex = 0
- .TintAndShade = 0
- .Weight = xlThin
- End With
- With myExcel.Selection.Borders(xlEdgeRight)
- .LineStyle = xlContinuous
- .ColorIndex = 0
- .TintAndShade = 0
- .Weight = xlThin
- End With
- With myExcel.Selection.Borders(xlInsideVertical)
- .LineStyle = xlContinuous
- .ColorIndex = 0
- .TintAndShade = 0
- .Weight = xlThin
- End With
- With myExcel.Selection.Borders(xlInsideHorizontal)
- .LineStyle = xlContinuous
- .ColorIndex = 0
- .TintAndShade = 0
- .Weight = xlThin
- End With
-
- myExcel.Application.PrintCommunication = False
- With myExcel.ActiveSheet.PageSetup
- .PrintTitleRows = ""
- .PrintTitleColumns = ""
- End With
- myExcel.Application.PrintCommunication = True
- myExcel.ActiveSheet.PageSetup.PrintArea = ""
- myExcel.Application.PrintCommunication = False
- With myExcel.ActiveSheet.PageSetup
- .LeftHeader = ""
- .CenterHeader = ""
- .RightHeader = ""
- .LeftFooter = ""
- .CenterFooter = ""
- .RightFooter = ""
- .LeftMargin = myExcel.Application.InchesToPoints(0.25)
- .RightMargin = myExcel.Application.InchesToPoints(0.25)
- .TopMargin = myExcel.Application.InchesToPoints(0.75)
- .BottomMargin = myExcel.Application.InchesToPoints(0.75)
- .HeaderMargin = myExcel.Application.InchesToPoints(0.3)
- .FooterMargin = myExcel.Application.InchesToPoints(0.3)
- .PrintHeadings = False
- .PrintGridlines = False
- .CenterHorizontally = False
- .CenterVertically = False
- .Draft = False
- .FirstPageNumber = xlAutomatic
- .BlackAndWhite = False
- .Zoom = False
- .FitToPagesWide = 1
- .FitToPagesTall = 0
- .OddAndEvenPagesHeaderFooter = False
- .DifferentFirstPageHeaderFooter = False
- .ScaleWithDocHeaderFooter = True
- .AlignMarginsHeaderFooter = True
- .EvenPage.LeftHeader.Text = ""
- .EvenPage.CenterHeader.Text = ""
- .EvenPage.RightHeader.Text = ""
- .EvenPage.LeftFooter.Text = ""
- .EvenPage.CenterFooter.Text = ""
- .EvenPage.RightFooter.Text = ""
- .FirstPage.LeftHeader.Text = ""
- .FirstPage.CenterHeader.Text = ""
- .FirstPage.RightHeader.Text = ""
- .FirstPage.LeftFooter.Text = ""
- .FirstPage.CenterFooter.Text = ""
- .FirstPage.RightFooter.Text = ""
- End With
- myExcel.Application.PrintCommunication = True
-
-
-
-
-
- xlSheet.Columns("A:A").ColumnWidth = 5
- xlSheet.Columns("B:B").ColumnWidth = 3
- xlSheet.Columns("C:C").ColumnWidth = 16
- xlSheet.Columns("D:D").ColumnWidth = 13
- xlSheet.Columns("E:E").ColumnWidth = 13
- xlSheet.Columns("F:F").ColumnWidth = 13
- xlSheet.Columns("G:G").ColumnWidth = 9
- xlSheet.Columns("H:H").ColumnWidth = 4
- xlSheet.Columns("I:I").ColumnWidth = 11
- xlSheet.Columns("J:J").ColumnWidth = 5
- xlSheet.Columns("K:K").WrapText = True
- If allSame Then
- If 顯示單據_cb.Checked = True Then
- xlSheet.Columns("K:K").ColumnWidth = 56.88
- Else
- xlSheet.Columns("K:K").ColumnWidth = 66.5
- End If
-
- Else
- If 顯示單據_cb.Checked = True Then
- xlSheet.Columns("K:K").ColumnWidth = 40.25
- Else
- xlSheet.Columns("K:K").ColumnWidth = 49.88
- End If
- End If
- xlSheet.Rows(N2 + 3 & ":" & N2 + 3).RowHeight = 100
-
- xlSheet.Range("A1:J1").Select()
- With myExcel.Selection.Font
- .Name = "標楷體"
- .Size = 16
- .Strikethrough = False
- .Superscript = False
- .Subscript = False
- .OutlineFont = False
- .Shadow = False
- .Underline = xlUnderlineStyleNone
- .ThemeColor = xlThemeColorLight1
- .TintAndShade = 0
- .ThemeFont = xlThemeFontNone
- End With
-
- xlSheet.Range("A1:J1").Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
-
- xlSheet.Range("A2:A3").Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = True
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
- xlSheet.Range("B2:B3").Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = True
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
-
- If 顯示單據_cb.Checked = True Then
- xlSheet.Range("C2:F3").Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = True
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
-
- xlSheet.Range("G2:G3").Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = True
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
-
- Else
- xlSheet.Range("C2:G3").Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = True
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
- End If
- xlSheet.Range("H2:H3").Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = True
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
- xlSheet.Range("I2:I3").Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
-
- xlSheet.Range("J4:J" & N2 + 1).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = True
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
-
- xlSheet.Range("A4:A" & N2 + 1).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
-
- xlSheet.Rows(2).AutoFit
- xlSheet.Rows(2).RowHeight = xlSheet.Rows(2).RowHeight + 1
- xlSheet.Rows(3).AutoFit
- xlSheet.Rows(3).RowHeight = xlSheet.Rows(3).RowHeight + 1
- For i As Integer = 4 To N2
- xlSheet.Range("B" & i).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
-
- xlSheet.Range("H" & i).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- If allSame Then
- If 顯示單據_cb.Checked = True Then
- xlSheet.Range("C" & i & ":F" & i).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlLeft
- .VerticalAlignment = xlCenter
- .WrapText = True
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
- xlSheet.Range("G" & i).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- Else
- xlSheet.Range("C" & i & ":G" & i).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlLeft
- .VerticalAlignment = xlCenter
- .WrapText = True
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
- End If
-
- Else
- xlSheet.Range("C" & i).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlLeft
- .VerticalAlignment = xlCenter
- .WrapText = True
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
- If 顯示單據_cb.Checked = True Then
- xlSheet.Range("D" & i & ":F" & i).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlLeft
- .VerticalAlignment = xlCenter
- .WrapText = True
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
- xlSheet.Range("G" & i).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- Else
-
-
- xlSheet.Range("D" & i & ":G" & i).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlLeft
- .VerticalAlignment = xlCenter
- .WrapText = True
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
- End If
-
- End If
-
-
- xlSheet.Range("I" & i).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlRight
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
- xlSheet.Rows(i).AutoFit
- xlSheet.Rows(i).RowHeight = xlSheet.Rows(i).RowHeight + 5
- xlSheet.Range("K" & i).Value = ""
-
- Next i
-
- xlSheet.Range("B" & N2 + 1 & ":H" & N2 + 1).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlRight
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
-
- xlSheet.Range("I" & N2 + 1).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlRight
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- 'myExcel.Selection.Merge
-
- xlSheet.Rows(N2 + 1).AutoFit
- xlSheet.Rows(N2 + 1).RowHeight = xlSheet.Rows(N2 + 1).RowHeight + 3
-
- xlSheet.Range("A" & N2 + 2 & ":B" & N2 + 2).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
-
- xlSheet.Range("G" & N2 + 2 & ":H" & N2 + 2).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
-
-
-
- xlSheet.Range("I" & N2 + 2 & ":J" & N2 + 2).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
- xlSheet.Range("A" & N2 + 3 & ":B" & N2 + 3).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
-
- xlSheet.Range("G" & N2 + 3 & ":H" & N2 + 3).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
-
-
- xlSheet.Range("I" & N2 + 3 & ":J" & N2 + 3).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- myExcel.Selection.Merge
- xlSheet.Range("J2:J3").Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
-
- xlSheet.Range("C" & N2 + 2 & ":F" & N2 + 2).Select()
-
- With myExcel.Selection
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .IndentLevel = 0
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = False
- End With
- 'xlSheet.Columns("K:K").ColumnWidth = 0
- End Sub
- Private Sub 公司編號_cb_Click(sender As Object, e As EventArgs) Handles 公司編號_cb.Click
- CB選擇清單(公司編號_cb, 公司編號_cb.Text)
- End Sub
-
-
- Private Sub 公司編號_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 公司編號_cb.SelectedIndexChanged
- Set_清單1() : Set_清單() : Set_清單2() : 彙總計算() : Set_費用清單()
- End Sub
-
-
- '----------------------滑鼠右鍵--------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Private Sub 重新讀取ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 重新讀取ToolStripMenuItem.Click
- Set_清單1() : Set_清單() : Set_清單2() : 彙總計算()
- End Sub
- Private Sub 字體_NUD_ValueChanged(sender As Object, e As EventArgs) Handles 字體_NUD.ValueChanged
- 單據彙總_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", 字體_NUD.Value)
- 財務彙總_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", 字體_NUD.Value)
- 明細_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", 字體_NUD.Value)
- End Sub
- Private Sub 支付單列印成EXCEL_MouseEnter(sender As Object, e As EventArgs) Handles 支付單列印成EXCEL.MouseEnter
- ToolTip1.SetToolTip(Me.支付單列印成EXCEL, "支付單列印成EXCEL")
- End Sub
-
- Private Function 大寫轉換(輸入文本 As String) As String
- Dim 個位(20), 十位(9), 百位(1), 千位(1), 百萬, 十億, 零, 拾, 百, 仟, 萬, 億, 兆, 答案 As String : Dim 數長 As Integer
- 答案 = "" : 零 = "" : 拾 = "" : 百 = "" : 仟 = "" : 萬 = "" : 百萬 = "" : 億 = "" : 十億 = "" : 兆 = ""
- 個位(0) = "零" : 個位(1) = "壹" : 個位(2) = "貳" : 個位(3) = "參" : 個位(4) = "肆" : 個位(5) = "伍" : 個位(6) = "陸" : 個位(7) = "柒" : 個位(8) = "捌" : 個位(9) = "玖"
- 零 = "零" : 拾 = "拾" : 百 = "百" : 仟 = "仟" : 萬 = "萬" : 億 = "億" : 兆 = "兆"
- '--------------轉大寫-----------------------------------------------------------
- Dim 位數(13), 末位數 As String
- Dim NB As Long = 輸入文本 : Dim NBS As String = NB.ToString() : 數長 = NBS.Length
- 位數(1) = Strings.Left(NBS, 1) : 末位數 = Strings.Right(NBS, 1)
- If 數長 >= 2 Then : 位數(2) = Strings.Mid(NBS, 2, 1) : End If : If 數長 >= 3 Then : 位數(3) = Strings.Mid(NBS, 3, 1) : End If
- If 數長 >= 4 Then : 位數(4) = Strings.Mid(NBS, 4, 1) : End If : If 數長 >= 5 Then : 位數(5) = Strings.Mid(NBS, 5, 1) : End If
- If 數長 >= 6 Then : 位數(6) = Strings.Mid(NBS, 6, 1) : End If : If 數長 >= 7 Then : 位數(7) = Strings.Mid(NBS, 7, 1) : End If
- If 數長 >= 8 Then : 位數(8) = Strings.Mid(NBS, 8, 1) : End If : If 數長 >= 9 Then : 位數(9) = Strings.Mid(NBS, 9, 1) : End If
- If 數長 >= 10 Then : 位數(10) = Strings.Mid(NBS, 10, 1) : End If : If 數長 >= 11 Then : 位數(11) = Strings.Mid(NBS, 11, 1) : End If
- If 數長 >= 12 Then : 位數(12) = Strings.Mid(NBS, 12, 1) : End If : If 數長 >= 13 Then : 位數(13) = Strings.Mid(NBS, 13, 1) : End If
-
- If 數長 = 1 Then : 答案 = 個位(輸入文本)
- ElseIf 數長 = 2 Then
- If 末位數 = "0" Then : 答案 = 個位(位數(1)) & 拾 : Else : 答案 = 個位(位數(1)) & 拾 & 個位(末位數) : End If
- ElseIf 數長 = 3 Then : 答案 = 個位(位數(1)) & 百
- If 位數(2) = "0" And 末位數 = "0" Then
- ElseIf 位數(2) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
- ElseIf 位數(2) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 拾
- ElseIf 位數(2) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 拾 & 個位(末位數)
- End If
- ElseIf 數長 = 4 Then : 答案 = 個位(位數(1)) & 仟
- If 位數(2) = "0" And 位數(3) = "0" And 末位數 = "0" Then
- ElseIf 位數(2) = "0" And 位數(3) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
- ElseIf 位數(2) = "0" And 位數(3) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾 & 個位(末位數)
- ElseIf 位數(2) = "0" And 位數(3) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾
- ElseIf 位數(2) <> "0" And 位數(3) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 百
- ElseIf 位數(2) <> "0" And 位數(3) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾
- ElseIf 位數(2) <> "0" And 末位數 <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾 & 個位(末位數)
- End If
- ElseIf 數長 = 5 Then : 答案 = 個位(位數(1)) & 萬
- If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" And 末位數 = "0" Then
- ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
- ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾
- ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾 & 個位(末位數)
- ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(3)) & 百
- ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾
- ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 個位(末位數)
- ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 仟
- ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(末位數)
- ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(位數(4)) & 拾
- ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(位數(4)) & 拾 & 個位(末位數)
- ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百
- ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾
- ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 個位(末位數)
- End If
- ElseIf 數長 = 6 Then
- If 位數(2) = "0" Then : 答案 = 個位(位數(1)) & 拾 & 萬 : Else : 答案 = 個位(位數(1)) & 拾 & 個位(位數(2)) & 萬 : End If
- If 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" And 末位數 = "0" Then
- ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
- ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾
- ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾 & 個位(末位數)
- ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(4)) & 百
- ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾
- ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 個位(末位數)
- ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(3)) & 仟
- ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(末位數)
- ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(位數(5)) & 拾
- ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(位數(5)) & 拾 & 個位(末位數)
- ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百
- ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾
- ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 個位(末位數)
- End If
- ElseIf 數長 = 7 Then : 答案 = 個位(位數(1)) & 百
- If 位數(2) = "0" And 位數(3) = "0" Then : 答案 &= 萬
- ElseIf 位數(2) = "0" And 位數(3) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 萬
- ElseIf 位數(2) <> "0" And 位數(3) = "0" Then : 答案 &= 個位(位數(2)) & 拾 & 萬
- ElseIf 位數(2) <> "0" And 位數(3) <> "0" Then : 答案 &= 個位(位數(2)) & 拾 & 個位(位數(3)) & 萬
- End If
- If 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" And 末位數 = "0" Then
- ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
- ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(6)) & 拾
- ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 拾 & 個位(末位數)
- ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(5)) & 百
- ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾
- ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 個位(末位數)
- ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(4)) & 仟
- ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(末位數)
- ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(位數(6)) & 拾
- ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(位數(6)) & 拾 & 個位(末位數)
- ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百
- ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾
- ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 個位(末位數)
- End If
- ElseIf 數長 = 8 Then : 答案 = 個位(位數(1)) & 仟
- If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= 萬
- ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 萬
- ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾 & 個位(位數(4)) & 萬
- ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾 & 萬
- ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= 個位(位數(2)) & 百 & 萬
- ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 零 & 個位(位數(4)) & 萬
- ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾 & 萬
- ElseIf 位數(2) <> "0" And 位數(4) <> "0" And 位數(4) <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾 & 個位(位數(4)) & 萬
- End If
- If 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" And 末位數 = "0" Then
- ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
- ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(7)) & 拾
- ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 拾 & 個位(末位數)
- ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(6)) & 百
- ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾
- ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 個位(末位數)
- ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(5)) & 仟
- ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(末位數)
- ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(位數(7)) & 拾
- ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(位數(7)) & 拾 & 個位(末位數)
- ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百
- ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾
- ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 個位(末位數)
- End If
- ElseIf 數長 = 9 Then : 答案 = 個位(位數(1)) & 億
- If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" Then
- ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 萬
- ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾 & 萬
- ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 萬
- ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 萬
- ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 零 & 個位(位數(5)) & 萬
- ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 萬
- ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 萬
- ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 萬
- ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(位數(5)) & 萬
- ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(位數(4)) & 拾 & 萬
- ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 零 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 萬
- ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 萬
- ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 零 & 個位(位數(5)) & 萬
- ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 萬
- ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(2)) & 仟 & 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 萬
- End If
- If 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" And 末位數 = "0" Then
- ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
- ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(8)) & 拾
- ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 拾 & 個位(末位數)
- ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(7)) & 百
- ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾
- ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 個位(末位數)
- ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(6)) & 仟
- ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(末位數)
- ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(位數(8)) & 拾
- ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(位數(8)) & 拾 & 個位(末位數)
- ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百
- ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾
- ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 個位(末位數)
- End If
- ElseIf 數長 = 10 Then
- If 位數(2) = "0" Then : 答案 = 個位(位數(1)) & 拾 & 億 : Else : 答案 = 個位(位數(1)) & 拾 & 個位(位數(2)) & 億 : End If
- If 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" Then
- ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 萬
- ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾 & 萬
- ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 萬
- ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 萬
- ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 零 & 個位(位數(6)) & 萬
- ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 萬
- ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 萬
- ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 萬
- ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(位數(6)) & 萬
- ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(位數(5)) & 拾 & 萬
- ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 零 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 萬
- ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 萬
- ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 零 & 個位(位數(6)) & 萬
- ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 萬
- ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(3)) & 仟 & 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 萬
- End If
- If 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" And 末位數 = "0" Then
- ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
- ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(9)) & 拾
- ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(9)) & 拾 & 個位(末位數)
- ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(8)) & 百
- ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾
- ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 個位(末位數)
- ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(7)) & 仟
- ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(末位數)
- ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(位數(9)) & 拾
- ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(位數(9)) & 拾 & 個位(末位數)
- ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百
- ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾
- ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 個位(末位數)
- End If
- ElseIf 數長 = 11 Then : 答案 = 個位(位數(1)) & 百
- If 位數(2) = "0" And 位數(3) = "0" Then : 答案 &= 億
- ElseIf 位數(2) = "0" And 位數(3) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 億
- ElseIf 位數(2) <> "0" And 位數(3) = "0" Then : 答案 &= 個位(位數(2)) & 拾 & 億
- ElseIf 位數(2) <> "0" And 位數(3) <> "0" Then : 答案 &= 個位(位數(2)) & 拾 & 個位(位數(3)) & 億
- End If
- If 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" Then
- ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 萬
- ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= 零 & 個位(位數(6)) & 拾 & 萬
- ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 拾 & 個位(位數(7)) & 萬
- ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 萬
- ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 零 & 個位(位數(7)) & 萬
- ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 萬
- ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 個位(位數(7)) & 萬
- ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 萬
- ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(位數(7)) & 萬
- ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(位數(6)) & 拾 & 萬
- ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 零 & 個位(位數(6)) & 拾 & 個位(位數(7)) & 萬
- ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 萬
- ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 零 & 個位(位數(7)) & 萬
- ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 萬
- ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" Then : 答案 &= 個位(位數(4)) & 仟 & 個位(位數(5)) & 百 & 個位(位數(6)) & 拾 & 個位(位數(7)) & 萬
- End If
- If 位數(8) = "0" And 位數(9) = "0" And 位數(10) = "0" And 末位數 = "0" Then
- ElseIf 位數(8) = "0" And 位數(9) = "0" And 位數(10) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
- ElseIf 位數(8) = "0" And 位數(9) = "0" And 位數(10) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(10)) & 拾
- ElseIf 位數(8) = "0" And 位數(9) = "0" And 位數(10) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(10)) & 拾 & 個位(末位數)
- ElseIf 位數(8) = "0" And 位數(9) <> "0" And 位數(10) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(9)) & 百
- ElseIf 位數(8) = "0" And 位數(9) <> "0" And 位數(10) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(9)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(8) = "0" And 位數(9) <> "0" And 位數(10) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(9)) & 百 & 個位(位數(10)) & 拾
- ElseIf 位數(8) = "0" And 位數(9) <> "0" And 位數(10) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(9)) & 百 & 個位(位數(10)) & 拾 & 個位(末位數)
- ElseIf 位數(8) <> "0" And 位數(9) = "0" And 位數(10) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(8)) & 仟
- ElseIf 位數(8) <> "0" And 位數(9) = "0" And 位數(10) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(8)) & 仟 & 零 & 個位(末位數)
- ElseIf 位數(8) <> "0" And 位數(9) = "0" And 位數(10) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(8)) & 仟 & 零 & 個位(位數(10)) & 拾
- ElseIf 位數(8) <> "0" And 位數(9) = "0" And 位數(10) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(8)) & 仟 & 零 & 個位(位數(10)) & 拾 & 個位(末位數)
- ElseIf 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(8)) & 仟 & 個位(位數(9)) & 百
- ElseIf 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(8)) & 仟 & 個位(位數(9)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(8)) & 仟 & 個位(位數(9)) & 百 & 個位(位數(10)) & 拾
- ElseIf 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(8)) & 仟 & 個位(位數(9)) & 百 & 個位(位數(10)) & 拾 & 個位(末位數)
- End If
- ElseIf 數長 = 12 Then : 答案 = 個位(位數(1)) & 仟
- If 位數(2) = "0" And 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= 億
- ElseIf 位數(2) = "0" And 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 億
- ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) <> "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾 & 個位(位數(4)) & 億
- ElseIf 位數(2) = "0" And 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= 零 & 個位(位數(3)) & 拾 & 億
- ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) = "0" Then : 答案 &= 個位(位數(2)) & 百 & 億
- ElseIf 位數(2) <> "0" And 位數(3) = "0" And 位數(4) <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 零 & 個位(位數(4)) & 億
- ElseIf 位數(2) <> "0" And 位數(3) <> "0" And 位數(4) = "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾 & 億
- ElseIf 位數(2) <> "0" And 位數(4) <> "0" And 位數(4) <> "0" Then : 答案 &= 個位(位數(2)) & 百 & 個位(位數(3)) & 拾 & 個位(位數(4)) & 億
- End If
- If 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" Then
- ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 萬
- ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= 零 & 個位(位數(7)) & 拾 & 萬
- ElseIf 位數(5) = "0" And 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 拾 & 個位(位數(8)) & 萬
- ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 萬
- ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 零 & 個位(位數(8)) & 萬
- ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 萬
- ElseIf 位數(5) = "0" And 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 個位(位數(8)) & 萬
- ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 萬
- ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(位數(8)) & 萬
- ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(位數(7)) & 拾 & 萬
- ElseIf 位數(5) <> "0" And 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 零 & 個位(位數(7)) & 拾 & 個位(位數(8)) & 萬
- ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 萬
- ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 零 & 個位(位數(8)) & 萬
- ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 萬
- ElseIf 位數(5) <> "0" And 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" Then : 答案 &= 個位(位數(5)) & 仟 & 個位(位數(6)) & 百 & 個位(位數(7)) & 拾 & 個位(位數(8)) & 萬
- End If
- If 位數(9) = "0" And 位數(10) = "0" And 位數(11) = "0" And 末位數 = "0" Then
- ElseIf 位數(9) = "0" And 位數(10) = "0" And 位數(11) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
- ElseIf 位數(9) = "0" And 位數(10) = "0" And 位數(11) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(11)) & 拾
- ElseIf 位數(9) = "0" And 位數(10) = "0" And 位數(11) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(11)) & 拾 & 個位(末位數)
- ElseIf 位數(9) = "0" And 位數(10) <> "0" And 位數(11) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(10)) & 百
- ElseIf 位數(9) = "0" And 位數(10) <> "0" And 位數(11) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(10)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(9) = "0" And 位數(10) <> "0" And 位數(11) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(10)) & 百 & 個位(位數(11)) & 拾
- ElseIf 位數(9) = "0" And 位數(10) <> "0" And 位數(11) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(10)) & 百 & 個位(位數(11)) & 拾 & 個位(末位數)
- ElseIf 位數(9) <> "0" And 位數(10) = "0" And 位數(11) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(9)) & 仟
- ElseIf 位數(9) <> "0" And 位數(10) = "0" And 位數(11) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(9)) & 仟 & 零 & 個位(末位數)
- ElseIf 位數(9) <> "0" And 位數(10) = "0" And 位數(11) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(9)) & 仟 & 零 & 個位(位數(11)) & 拾
- ElseIf 位數(9) <> "0" And 位數(10) = "0" And 位數(11) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(9)) & 仟 & 零 & 個位(位數(11)) & 拾 & 個位(末位數)
- ElseIf 位數(9) <> "0" And 位數(10) <> "0" And 位數(11) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(9)) & 仟 & 個位(位數(10)) & 百
- ElseIf 位數(9) <> "0" And 位數(10) <> "0" And 位數(11) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(9)) & 仟 & 個位(位數(10)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(9) <> "0" And 位數(10) <> "0" And 位數(11) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(9)) & 仟 & 個位(位數(10)) & 百 & 個位(位數(11)) & 拾
- ElseIf 位數(9) <> "0" And 位數(10) <> "0" And 位數(11) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(9)) & 仟 & 個位(位數(10)) & 百 & 個位(位數(11)) & 拾 & 個位(末位數)
- End If
- ElseIf 數長 = 13 Then : 答案 = 個位(位數(1)) & 兆 : 答案 &= 個位(位數(2)) & 仟
- If 位數(3) = "0" And 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= 億
- ElseIf 位數(3) = "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 億
- ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) <> "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 億
- ElseIf 位數(3) = "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 零 & 個位(位數(4)) & 拾 & 億
- ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(3)) & 百 & 億
- ElseIf 位數(3) <> "0" And 位數(4) = "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(3)) & 百 & 零 & 個位(位數(5)) & 億
- ElseIf 位數(3) <> "0" And 位數(4) <> "0" And 位數(5) = "0" Then : 答案 &= 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 億
- ElseIf 位數(3) <> "0" And 位數(5) <> "0" And 位數(5) <> "0" Then : 答案 &= 個位(位數(3)) & 百 & 個位(位數(4)) & 拾 & 個位(位數(5)) & 億
- End If
- If 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" Then
- ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" Then : 答案 &= 零 & 個位(位數(9)) & 萬
- ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= 零 & 個位(位數(8)) & 拾 & 萬
- ElseIf 位數(6) = "0" And 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 拾 & 個位(位數(9)) & 萬
- ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 萬
- ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 零 & 個位(位數(9)) & 萬
- ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 萬
- ElseIf 位數(6) = "0" And 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= 零 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 個位(位數(9)) & 萬
- ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 萬
- ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(位數(9)) & 萬
- ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(位數(8)) & 拾 & 萬
- ElseIf 位數(6) <> "0" And 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 零 & 個位(位數(8)) & 拾 & 個位(位數(9)) & 萬
- ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 萬
- ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 零 & 個位(位數(9)) & 萬
- ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 萬
- ElseIf 位數(6) <> "0" And 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" Then : 答案 &= 個位(位數(6)) & 仟 & 個位(位數(7)) & 百 & 個位(位數(8)) & 拾 & 個位(位數(9)) & 萬
- End If
- If 位數(10) = "0" And 位數(11) = "0" And 位數(12) = "0" And 末位數 = "0" Then
- ElseIf 位數(10) = "0" And 位數(11) = "0" And 位數(12) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
- ElseIf 位數(10) = "0" And 位數(11) = "0" And 位數(12) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(12)) & 拾
- ElseIf 位數(10) = "0" And 位數(11) = "0" And 位數(12) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(12)) & 拾 & 個位(末位數)
- ElseIf 位數(10) = "0" And 位數(11) <> "0" And 位數(12) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(11)) & 百
- ElseIf 位數(10) = "0" And 位數(11) <> "0" And 位數(12) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(11)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(10) = "0" And 位數(11) <> "0" And 位數(12) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(11)) & 百 & 個位(位數(12)) & 拾
- ElseIf 位數(10) = "0" And 位數(11) <> "0" And 位數(12) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(11)) & 百 & 個位(位數(12)) & 拾 & 個位(末位數)
- ElseIf 位數(10) <> "0" And 位數(11) = "0" And 位數(12) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(10)) & 仟
- ElseIf 位數(10) <> "0" And 位數(11) = "0" And 位數(12) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(10)) & 仟 & 零 & 個位(末位數)
- ElseIf 位數(10) <> "0" And 位數(11) = "0" And 位數(12) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(10)) & 仟 & 零 & 個位(位數(12)) & 拾
- ElseIf 位數(10) <> "0" And 位數(11) = "0" And 位數(12) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(10)) & 仟 & 零 & 個位(位數(12)) & 拾 & 個位(末位數)
- ElseIf 位數(10) <> "0" And 位數(11) <> "0" And 位數(12) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(10)) & 仟 & 個位(位數(11)) & 百
- ElseIf 位數(10) <> "0" And 位數(11) <> "0" And 位數(12) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(10)) & 仟 & 個位(位數(11)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(10) <> "0" And 位數(11) <> "0" And 位數(12) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(10)) & 仟 & 個位(位數(11)) & 百 & 個位(位數(12)) & 拾
- ElseIf 位數(10) <> "0" And 位數(11) <> "0" And 位數(12) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(10)) & 仟 & 個位(位數(11)) & 百 & 個位(位數(12)) & 拾 & 個位(末位數)
- End If
- ElseIf 數長 = 14 Then
- If 位數(2) = "0" Then : 答案 = 個位(位數(1)) & 拾 & 兆 : Else : 答案 = 個位(位數(1)) & 拾 & 個位(位數(2)) & 兆 : End If : 答案 &= 個位(位數(3)) & 仟
- If 位數(4) = "0" And 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= 億
- ElseIf 位數(4) = "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(6)) & 億
- ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) <> "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 億
- ElseIf 位數(4) = "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 零 & 個位(位數(5)) & 拾 & 億
- ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(4)) & 百 & 億
- ElseIf 位數(4) <> "0" And 位數(5) = "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(4)) & 百 & 零 & 個位(位數(6)) & 億
- ElseIf 位數(4) <> "0" And 位數(5) <> "0" And 位數(6) = "0" Then : 答案 &= 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 億
- ElseIf 位數(4) <> "0" And 位數(6) <> "0" And 位數(6) <> "0" Then : 答案 &= 個位(位數(4)) & 百 & 個位(位數(5)) & 拾 & 個位(位數(6)) & 億
- End If
- If 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" And 位數(10) = "0" Then
- ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) = "0" And 位數(10) <> "0" Then : 答案 &= 零 & 個位(位數(10)) & 萬
- ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= 零 & 個位(位數(9)) & 拾 & 萬
- ElseIf 位數(7) = "0" And 位數(8) = "0" And 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= 零 & 個位(位數(9)) & 拾 & 個位(位數(10)) & 萬
- ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" And 位數(10) = "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 萬
- ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) = "0" And 位數(10) <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 零 & 個位(位數(10)) & 萬
- ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 萬
- ElseIf 位數(7) = "0" And 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= 零 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 個位(位數(10)) & 萬
- ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" And 位數(10) = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 萬
- ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) = "0" And 位數(10) <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(位數(10)) & 萬
- ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(位數(9)) & 拾 & 萬
- ElseIf 位數(7) <> "0" And 位數(8) = "0" And 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 零 & 個位(位數(9)) & 拾 & 個位(位數(10)) & 萬
- ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" And 位數(10) = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 萬
- ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) = "0" And 位數(10) <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 零 & 個位(位數(10)) & 萬
- ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) = "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 萬
- ElseIf 位數(7) <> "0" And 位數(8) <> "0" And 位數(9) <> "0" And 位數(10) <> "0" Then : 答案 &= 個位(位數(7)) & 仟 & 個位(位數(8)) & 百 & 個位(位數(9)) & 拾 & 個位(位數(10)) & 萬
- End If
- If 位數(11) = "0" And 位數(12) = "0" And 位數(13) = "0" And 末位數 = "0" Then
- ElseIf 位數(11) = "0" And 位數(12) = "0" And 位數(13) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(末位數)
- ElseIf 位數(11) = "0" And 位數(12) = "0" And 位數(13) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(13)) & 拾
- ElseIf 位數(11) = "0" And 位數(12) = "0" And 位數(13) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(13)) & 拾 & 個位(末位數)
- ElseIf 位數(11) = "0" And 位數(12) <> "0" And 位數(13) = "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(12)) & 百
- ElseIf 位數(11) = "0" And 位數(12) <> "0" And 位數(13) = "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(12)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(11) = "0" And 位數(12) <> "0" And 位數(13) <> "0" And 末位數 = "0" Then : 答案 &= 零 & 個位(位數(12)) & 百 & 個位(位數(13)) & 拾
- ElseIf 位數(11) = "0" And 位數(12) <> "0" And 位數(13) <> "0" And 末位數 <> "0" Then : 答案 &= 零 & 個位(位數(12)) & 百 & 個位(位數(13)) & 拾 & 個位(末位數)
- ElseIf 位數(11) <> "0" And 位數(12) = "0" And 位數(13) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(11)) & 仟
- ElseIf 位數(11) <> "0" And 位數(12) = "0" And 位數(13) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(11)) & 仟 & 零 & 個位(末位數)
- ElseIf 位數(11) <> "0" And 位數(12) = "0" And 位數(13) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(11)) & 仟 & 零 & 個位(位數(13)) & 拾
- ElseIf 位數(11) <> "0" And 位數(12) = "0" And 位數(13) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(11)) & 仟 & 零 & 個位(位數(13)) & 拾 & 個位(末位數)
- ElseIf 位數(11) <> "0" And 位數(12) <> "0" And 位數(13) = "0" And 末位數 = "0" Then : 答案 &= 個位(位數(11)) & 仟 & 個位(位數(12)) & 百
- ElseIf 位數(11) <> "0" And 位數(12) <> "0" And 位數(13) = "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(11)) & 仟 & 個位(位數(12)) & 百 & 零 & 個位(末位數)
- ElseIf 位數(11) <> "0" And 位數(12) <> "0" And 位數(13) <> "0" And 末位數 = "0" Then : 答案 &= 個位(位數(11)) & 仟 & 個位(位數(12)) & 百 & 個位(位數(13)) & 拾
- ElseIf 位數(11) <> "0" And 位數(12) <> "0" And 位數(13) <> "0" And 末位數 <> "0" Then : 答案 &= 個位(位數(11)) & 仟 & 個位(位數(12)) & 百 & 個位(位數(13)) & 拾 & 個位(末位數)
- End If
- End If
-
- Return 答案
-
- End Function
- End Class
|