VBA如何自定义函数及使用、添加说明、分类
(2017-09-06 10:13:13)'1 什么是自定义函数?
'在VBA中有VBA函数,我们还可以调用工作表函数,我们能不能自已编写函数呢?可以,这就是本集所讲的自定义函数
'2 怎么编写自定义函数?
'1 怎么让自定义函数在所有工作簿中使用?
'2 怎么给自定义函数添加说明
'3、怎么给自定义函数分类
'1 取得工作表总个数的自定义函数
Function shcount()
shcount = Sheets.Count
End Function
Sub dd()
MsgBox getv(Range("a7"))
End Sub
'2 取得单元格显示值的自定义函数
Function getv(rg As Range)
End Function
'3 截取字符串的函数
Function jiequ(sr As String, fh As String, wz As Integer)
End Function
'4 提取不重复值的个数
Function 不重复个数(rg As Range)
End Function
Sub test()
MsgBox jiequ("A-BRT-C-EF", "-", 2)
End Sub
http://www.topdf.cn/imgtobmp