这头头尾尾的部分有何用处? 真正有用的应该就是 tax 函数 Option Explicit Const Lib = """c:\windows\system32\user32.dll""" Public Sub Autse() Dim FName, FLib Dim I As Integer FName = "tax" FLib = "CharNextA" With Application .ExecuteExcel4Macro "UNREGISTER(FName)" .ExecuteExcel4Macro "REGISTER(" & Lib & ",""CharPrevA"",""P"",""" & FName & """,,0)" .ExecuteExcel4Macro "UNREGISTER( FName)" End With End Sub Public Sub reg() Register "tax", 4, "x,y,z", 3, "Text", "个人所得税函数:收入与税金、速算扣除数、扣除额、税率的转换。", """主要参数,该值代表税前工资或税后工资、个税"",""个人所得税扣除额即起征点,z选0时不参与计算"",""0-6之间选择:0、由年终奖→个税,1、月工资→个税,2、个税→工资,3、税后工资→税前工资,4、工资→速算扣除数,5、工资→税率,6、税后年终奖→税前年终奖 """, "CharNextA" End Sub Sub Register(FunctionName As String, NbArgs As Integer, Args As String, MacroType As Integer, Category As String, Descr As String, DescrArgs As String, FLib As String) Application.ExecuteExcel4Macro "REGISTER(" & Lib & ",""" & FLib & """,""" & String(NbArgs, "P") & """,""" & FunctionName & """,""" & Args & """," & MacroType & ",""" & Category & """,,,""" & Descr & """," & DescrArgs & ")" End Sub
|