原帖由 kittymam 於 09-4-27 15:05 發表
如題,如係B2輸入HKD1200.25,點樣係A2自動變成:HONG KONG DOLLARS ONE THOUSAND TWO HUNDRED AND CENTS TWENTY FIVE ONLY. 搵食艰難啊,請幫下忙,唔該!
aste", locate your new function. Test it and seem OK. The only missing is HK Dollars. For that, use concat function.原帖由 kittymam 於 09-4-27 15:05 發表
如題,如係B2輸入HKD1200.25,點樣係A2自動變成:HONG KONG DOLLARS ONE THOUSAND TWO HUNDRED AND CENTS TWENTY FIVE ONLY. 搵食艰難啊,請幫下忙,唔該!










原帖由 小必理痛 於 09-4-29 14:59 發表
睇怕都要圖文並茂講解一次了:
1. 係Excel嘅menu度選:工具->巨集->Visual Basic 編輯器
2. 進入編輯器後,係左邊專案窗度右Click呢個Microsoft Excel物件 ...


原帖由 kittymam 於 09-4-30 09:59 發表
小必理痛:
多謝晒,但又有嘢請教啊,唔該!
唔好意思,我真係好白痴,我唔知去邊度開返舊有的模組來改,要點架?
我唔識唯有另開一個新的excel來設巨集,但copy你設的去改,當我打15.05佢出"fifteenfive",咁又唔啱了,點算? ...





原帖由 小必理痛 於 09-4-30 11:46 發表
我發覺原來我都係一個幾差嘅人,我冇睇清楚你嘅requirement,真係抱歉!
再黎:
將原先最開初話有No Cent個段,即係如下:
Select Case Dollars
Case ""
Dollars = "No Dollars"
Case "One"
Dollars = "One Dollar"
Case Else
Dollars = Dollars & " Dollars"
End Select
Select Case Cents
Case ""
Cents = " and No Cents"
Case "One"
Cents = " and One Cent"
Case Else
Cents = " and " & Cents & " Cents"
End Select
SpellNumber = Dollars & Cents
改成如下:
If Cents <> "" Then
Cents = " and " & IIf(Cents = "One", "Cent ", "Cents ") & Trim(Cents)
End If
SpellNumber = Dollars & Cents & " Only"



